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

Re: zle_refresh patch 2



Bart Schaefer wrote:
> This patch is against the base 3.0.3-test4, so there may be a conflict in
> the utils.c hunk with Geoff's patch.  Nevertheless, the rest of Geoff's
> patch (to the zle* files) is required.

Fine, but there are two problems: shortterm is a zle variable and in 3.1
utils.c has no access to zle globals.  The other problem is that
resetneeded local variable has the same name as a global one, which is
misleading.  Also a comparision should use >= 3 instead on > 3.  I simply
removed the resetneeded variable, since it was really unnecessary.

Zoltan


diff -c Src/params.c.bart Src/params.c
*** Src/params.c.bart   Wed Mar  5 18:40:19 1997
--- Src/params.c        Wed Mar  5 18:42:57 1997
***************
*** 1266,1273 ****
  void
  zlevarsetfn(Param pm, long x)
  {
-     int resetneeded = 0;
-
      if ((long *)pm->data == & columns) {
        if (x < 3) {
            if (x <= 0)
--- 1266,1271 ----
***************
*** 1275,1297 ****
            else
                x = 2;
            termok = TERM_BAD;
!       } else if (columns < 3)
!           resetneeded = 1;
      } else if ((long *)pm->data == & lines) {
        if (x < 3) {
            if (x <= 0)
                x = 24;         /* Arbitrary, but same as init.c */
            termok = TERM_NOUP;
!       } else if (lines < 3)
!           resetneeded = 1;
      }

      *((long *)pm->data) = x;
-
-     if (resetneeded) {
-       if (lines > 3 && columns > 3 && termok != TERM_OK)
-           init_term();        /* Attempt to reset termok properly */
-     }
  }

  /* Function to set value of generic special scalar    *
--- 1273,1290 ----
            else
                x = 2;
            termok = TERM_BAD;
!       } else if (columns < 3 && lines >= 3 && termok != TERM_OK)
!           init_term();        /* Attempt to reset termok properly */
      } else if ((long *)pm->data == & lines) {
        if (x < 3) {
            if (x <= 0)
                x = 24;         /* Arbitrary, but same as init.c */
            termok = TERM_NOUP;
!       } else if (lines < 3 && columns >= 3 && termok != TERM_OK)
!           init_term();        /* Attempt to reset termok properly */
      }

      *((long *)pm->data) = x;
  }

  /* Function to set value of generic special scalar    *
diff -c Src/utils.c.bart Src/utils.c
*** Src/utils.c.bart    Wed Mar  5 18:39:57 1997
--- Src/utils.c Wed Mar  5 18:40:22 1997
***************
*** 813,820 ****
        }
      }
  #endif   /*  TIOCGWINSZ */
-     DPUTS((!(isset(SINGLELINEZLE) || termok != TERM_OK || lines < 3)
-          != !shortterm), "BUG: shortterm wrong in adjustwinsize");
  }

  /* Move a fd to a place >= 10 and mark the new fd in fdtable.  If the fd *
--- 813,818 ----



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