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

Re: PATCH: fixing ${1+"$@"} when word-splitting



One other minor fix that I noticed in my patched code affects a request
for no-splitting when SH_WORD_SPLIT is enabled:

  setopt shwordsplit
  foo='1 2'
  print -l ${==foo+$foo}

That used to split the variable $foo if it was not quoted (an
interesting case where quotes made a difference in the old code).

I've checked in my changes, including a couple new sentences in the
zshexpn man page.

If we decide that the change in splitting is undesirable after all, the
following one-line change will put things back to the way they were
before (except that the bug above will still be fixed):

--- Src/subst.c	2006-02-15 01:58:31 -0800
+++ Src/subst.c	2006-02-15 02:03:41 -0800
@@ -2065,7 +2065,7 @@
 		multsub(&val, spbreak && !aspar, (aspar ? NULL : &aval), &isarr, NULL);
 		opts[SHWORDSPLIT] = ws;
 		copied = 1;
-		spbreak = 0;
+		/*spbreak = 0;*/
 	    }
 	    break;
 	case ':':

Of course, we'd also need to change some of the D04 tests and the docs.

..wayne..



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