Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: Very odd behaviour with zsh, maybe corruption bug
- X-seq: zsh-workers 16038
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: martin.ebourne@xxxxxxxxxxxx, zsh-workers@xxxxxxxxxx
- Subject: PATCH: Re: Very odd behaviour with zsh, maybe corruption bug
- Date: Sun, 14 Oct 2001 21:56:07 +0000
- In-reply-to: <1011012050227.ZM19535@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <OFFE2ABA9E.2332FF4A-ON80256AE2.0038ACE5@xxxxxxxxxxxxxxx> <1011012050227.ZM19535@xxxxxxxxxxxxxxxxxxxxxxx>
On Oct 12, 5:02am, Bart Schaefer wrote:
}
} This *must* be a bug in prefork() called via singsub(); it must be zeroing
} `right' (and thus also zeroing `opat') before copying the string. But I
} just can't seem to catch it happening.
Having traced through this more closely, which was rather laborious, I
have come to the conclusion that the bug is right there in evalcond(),
and that the following is the fix. At least, I can't see how this patch
could possibly cause -incorrect- behavior, though it might result in an
optimization being skipped unnecessarily in some cases.
Sven, please dispute this if you can.
Index: Src/cond.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/cond.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 cond.c
--- Src/cond.c 2001/04/09 20:14:12 1.1.1.1
+++ Src/cond.c 2001/10/14 21:48:55
@@ -202,7 +202,7 @@
char *opat;
int save;
- right = opat = dupstring(ecrawstr(state->prog, state->pc,
+ right = dupstring(opat = ecrawstr(state->prog, state->pc,
&htok));
if (htok)
singsub(&right);
--
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author