From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: Re: PATCH: Re: More incompatibility (word splitting)
Date: Fri, 16 Feb 2001 17:03:44 +0000 [thread overview]
Message-ID: <1010216170344.ZM19462@candle.brasslantern.com> (raw)
In-Reply-To: <001601c097f5$90e19b20$21c9ca95@mow.siemens.ru>
On Feb 16, 11:50am, Andrej Borsenkow wrote:
} Subject: RE: PATCH: Re: More incompatibility (word splitting)
}
} > Here's the patch as I'm willing to commit it right now.
}
} Does it really fix two described incompatibilities? O
It fixes the incompatibility with 3.0.8, i.e. ${1+"$@"} does the right
thing when *not* emulating sh, which it didn't before.
It fixes "${(A)foo=$bar[@]}" but not [ ${foo=""} = "true" ].
Although actually, sigh, it breaks "${(A)=foo=$bar}" in that it splits
$bar and assigns the array to $foo but then doesn't split $foo when it
substitutes the end result.
--- zsh-forge/current/Src/subst.c Fri Feb 16 00:35:19 2001
+++ zsh-3.1.9/Src/subst.c Fri Feb 16 08:18:49 2001
@@ -1015,7 +1015,7 @@
spbreak = 0;
s++;
} else
- spbreak = 1;
+ spbreak = 2;
} else if ((c == '#' || c == Pound) &&
(iident(cc = s[1])
|| cc == '*' || cc == Star || cc == '@'
@@ -1414,8 +1414,6 @@
if (spsep || spbreak) {
aval = sepsplit(val, spsep, 0, 1);
isarr = 2;
- sep = spsep = NULL;
- spbreak = 0;
l = arrlen(aval);
if (l && !*(aval[l-1]))
l--;
@@ -1456,10 +1454,12 @@
if (isarr) {
if (nojoin)
isarr = -1;
- if (qt && !getlen && isarr > 0) {
+ if (qt && !getlen && isarr > 0 && !spsep && spbreak < 2) {
val = sepjoin(aval, sep, 1);
isarr = 0;
}
+ sep = spsep = NULL;
+ spbreak = 0;
}
}
break;
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
prev parent reply other threads:[~2001-02-16 17:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <000d01c0926a$ce26c590$21c9ca95@mow.siemens.ru>
2001-02-09 18:18 ` Word splitting in zsh Bart Schaefer
2001-02-10 20:24 ` PATCH: 3.1.9-dev-8: " Bart Schaefer
2001-02-12 7:38 ` Andrej Borsenkow
2001-02-12 14:12 ` Andrej Borsenkow
2001-02-12 19:38 ` Bart Schaefer
2001-02-13 7:51 ` More incompatibility :-) " Andrej Borsenkow
2001-02-13 9:26 ` Bart Schaefer
2001-02-13 9:57 ` Andrej Borsenkow
2001-02-13 19:33 ` Bart Schaefer
2001-02-14 18:00 ` Peter Stephenson
2001-02-15 6:17 ` Andrej Borsenkow
2001-02-15 8:34 ` Bart Schaefer
2001-02-15 10:35 ` More incompatibility (word splitting) Peter Stephenson
2001-02-16 7:43 ` PATCH: " Bart Schaefer
2001-02-16 8:50 ` Andrej Borsenkow
2001-02-16 17:03 ` Bart Schaefer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1010216170344.ZM19462@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).