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

Re: case $? fails



Bart Schaefer wrote:
> } prints zero.  The patch below fixes these.  The for syntax is new in
> } zsh-3.1 so the first two hunks should be removed if the patch is applied
> } against zsh-3.0.3-test4.
>
> The first two hunks?  Or the second two hunks?
>
> I've now tried this a couple of different ways and can't get it to apply
> to 3.0.3-test4.  Could you send a patch specifically for that?

It applied cleanly for me after removing the first two hunks.  But here is
the patch for 3.0.3-test4 anyway.

Zoltan


*** loop.c      1996/12/29 01:47:11     3.0.2.1
--- loop.c      1997/02/28 16:16:48
***************
*** 168,178 ****

      olderrexit = noerrexit;
      node = cmd->u.whilecmd;
!     lastval = 0;
      pushheap();
      loops++;
      for (;;) {
-       oldval = lastval;
        list = (List) dupstruct(node->cont);
        noerrexit = 1;
        execlist(list, 1, 0);
--- 168,177 ----

      olderrexit = noerrexit;
      node = cmd->u.whilecmd;
!     oldval = 0;
      pushheap();
      loops++;
      for (;;) {
        list = (List) dupstruct(node->cont);
        noerrexit = 1;
        execlist(list, 1, 0);
***************
*** 196,201 ****
--- 195,201 ----
            lastval = 1;
            break;
        }
+       oldval = lastval;
      }
      popheap();
      loops--;
***************
*** 282,291 ****
      l = node->lists;
      p = node->pats;

-     lastval = 0;
      word = *p++;
      singsub(&word);
      untokenize(word);

      if (node) {
        while (*p) {
--- 282,291 ----
      l = node->lists;
      p = node->pats;

      word = *p++;
      singsub(&word);
      untokenize(word);
+     lastval = 0;

      if (node) {
        while (*p) {



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