zsh-workers
 help / color / mirror / code / Atom feed
* Re: handling of variables
       [not found]     ` <1050201164011.ZM9367@candle.brasslantern.com>
@ 2005-02-02  3:47       ` Bart Schaefer
  2005-02-02 12:48         ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2005-02-02  3:47 UTC (permalink / raw)
  To: zsh-workers

[moved to -workers]

On Feb 1,  4:40pm, Bart Schaefer wrote:
} 
} I now think that exec.c:save_params() needs to copy the value returned
} by ecrawstr() before storing it in the restore_p linked list

That should say "remove_p" not "restore_p".

} but I'm not sure what kind of memory to copy it into

Got a chance to look at this again; addlinknode() uses the heap, so it
should be safe to dupstring() here.

And the following does indeed fix the problem.

Index: Src/exec.c
===================================================================
diff -c -r1.23 exec.c
--- Src/exec.c	13 Jan 2005 04:12:14 -0000	1.23
+++ Src/exec.c	2 Feb 2005 03:41:43 -0000
@@ -2554,10 +2554,10 @@
 		copyparam(tpm, pm, 1);
 		pm = tpm;
 	    }
-	    addlinknode(*remove_p, s);
+	    addlinknode(*remove_p, dupstring(s));
 	    addlinknode(*restore_p, pm);
 	} else
-	    addlinknode(*remove_p, s);
+	    addlinknode(*remove_p, dupstring(s));
 
 	pc += (WC_ASSIGN_TYPE(ac) == WC_ASSIGN_SCALAR ?
 	       3 : WC_ASSIGN_NUM(ac) + 2);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: handling of variables
  2005-02-02  3:47       ` handling of variables Bart Schaefer
@ 2005-02-02 12:48         ` Peter Stephenson
  2005-02-02 15:24           ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2005-02-02 12:48 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer wrote:
> And the following does indeed fix the problem.

This might be a good opportunity for me to release 4.2.4?  I'll update
the necessary files anyway.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: handling of variables
  2005-02-02 12:48         ` Peter Stephenson
@ 2005-02-02 15:24           ` Bart Schaefer
  2005-02-02 16:58             ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2005-02-02 15:24 UTC (permalink / raw)
  To: zsh-workers

On Feb 2, 12:48pm, Peter Stephenson wrote:
} 
} This might be a good opportunity for me to release 4.2.4?

I'd say so.  It'd be good if someone could actually run through a full
"make;make check" on Cygwin, though.  I did it on both RH6.2 and RHEL3
so I'm reasonably confident otherwise.

Hmm, though, I suppose we should have added regression tests for those
bug fixes.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: handling of variables
  2005-02-02 15:24           ` Bart Schaefer
@ 2005-02-02 16:58             ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2005-02-02 16:58 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer wrote:
> Hmm, though, I suppose we should have added regression tests for those
> bug fixes.

Index: Test/A06assign.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/A06assign.ztst,v
retrieving revision 1.2
diff -u -r1.2 A06assign.ztst
--- Test/A06assign.ztst	7 Jul 2004 15:40:57 -0000	1.2
+++ Test/A06assign.ztst	2 Feb 2005 16:50:56 -0000
@@ -264,3 +264,16 @@
 >hello
 >hello
 >hello
+
+ repeat 10 FOO=BAR BAR=FOO echo $FOO $BAR
+0:save and restore multiple variables around builtin
+>
+>
+>
+>
+>
+>
+>
+>
+>
+>
Index: Test/C02cond.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/C02cond.ztst,v
retrieving revision 1.14
diff -u -r1.14 C02cond.ztst
--- Test/C02cond.ztst	17 Mar 2004 14:22:20 -0000	1.14
+++ Test/C02cond.ztst	2 Feb 2005 16:50:56 -0000
@@ -195,6 +195,16 @@
   [ `echo 0` -lt `echo 1` ]
 0:substituion in `[' builtin
 
+  fn() {
+    # careful: first file must exist to trigger bug
+    [[ -e unmodified ]] || print Where\'s my file\?
+    [[ unmodified -nt NonExistentFile ]]
+    print status = $?
+  }
+  fn
+0:-nt shouldn't abort on non-existent files
+>status = 1
+
 %clean
   # This works around a bug in rm -f in some versions of Cygwin
   chmod 644 unmodish


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited. 
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-02 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <2005-02-01T12-49-14@devnull.michael-prokop.at>
     [not found] ` <200502011410.j11EAA9D029705@news01.csr.com>
     [not found]   ` <1050201152428.ZM9278@candle.brasslantern.com>
     [not found]     ` <1050201164011.ZM9367@candle.brasslantern.com>
2005-02-02  3:47       ` handling of variables Bart Schaefer
2005-02-02 12:48         ` Peter Stephenson
2005-02-02 15:24           ` Bart Schaefer
2005-02-02 16:58             ` Peter Stephenson

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).