Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Still problems with scriptname (presumably)



Peter Stephenson wrote:

> % zsh -c 'echo '\' this_is_not_the_command_name
> this_is_not_the_command_name:-1: unmatched '
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> this is the bit I object to, the error message is OK.

Note: no `PATCH:' in the subject...

I was about to send/commit the patch below (which is kinda brute
force, setting scriptname to zsh when there is a -c option on the
command line).


But then I tried ksh and bash. ksh doesn't give me an error (?!?) and
bash does the same as zsh currently does.

I don't need to say that compatibility to bash doesn't interest me, do I?

So, should I commit the change?

Bye
 Sven

Index: Src/init.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/init.c,v
retrieving revision 1.1.1.51
diff -u -r1.1.1.51 init.c
--- Src/init.c	2000/03/23 04:22:57	1.1.1.51
+++ Src/init.c	2000/04/04 12:09:26
@@ -222,6 +222,7 @@
 		cmd = *argv;
 		opts[INTERACTIVE] &= 1;
 		opts[SHINSTDIN] = 0;
+		scriptname = ztrdup("zsh");
 	    } else if (**argv == 'o') {
 		if (!*++*argv)
 		    argv++;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author