From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id OAA04808 for ; Fri, 23 Aug 1996 14:37:27 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id AAA12748; Fri, 23 Aug 1996 00:39:33 -0400 (EDT) Resent-Date: Fri, 23 Aug 1996 00:39:33 -0400 (EDT) From: Geoff Wing Message-Id: <199608230432.OAA04762@coral.primenet.com.au> Subject: bodgy COLUMNS coredump To: zsh-workers@math.gatech.edu Date: Fri, 23 Aug 1996 14:32:08 +1000 (EST) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"Fe3Ih.0.673.5OJ7o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2053 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Heyla, to get zsh to coredump on command. % COLUMNS=1 Here's a patch, though I'm not very happy with it. It provides more of a kludge than a clean fix. Testing this also unveiled another bug (coredump) in hist.c:620 hbegin->zsfree->zfree which I haven't looked at yet. I got this by taking my xterm window down to 1 or 2 columns. One interesting thing that happened to me was gdb coredumped while loading up zsh & zsh.core :-) I won't have much time in the next couple of weeks to look at this, but if someone hasn't cleaned it up by then, I'll see what I can do then. *** zsh.h 1996/08/15 16:41:25 2.44 --- zsh.h 1996/08/23 04:12:14 *************** *** 1246,1252 **** #define txtchangeisset(X) (txtchange & (X)) #define txtchangeset(X, Y) (txtchange |= (X), txtchange &= ~(Y)) ! #define COLUMNS (columns < 1 ? 80 : columns) /****************************************/ /* Definitions for the %_ prompt escape */ --- 1246,1252 ---- #define txtchangeisset(X) (txtchange & (X)) #define txtchangeset(X, Y) (txtchange |= (X), txtchange &= ~(Y)) ! #define COLUMNS (columns < 2 ? 80 : columns) /****************************************/ /* Definitions for the %_ prompt escape */ *** init.c 1996/08/13 20:36:44 2.39 --- init.c 1996/08/23 03:59:53 *************** *** 541,546 **** --- 541,547 ---- columns = 80; lines = 24; #endif + columns = COLUMNS; /* sanity */ /* The following variable assignments cause zsh to behave more * * like Bourne and Korn shells when invoked as "sh" or "ksh". * *** utils.c 1996/08/14 16:21:47 2.51 --- utils.c 1996/08/23 04:00:09 *************** *** 841,846 **** --- 841,847 ---- ioctl(SHTTY, TIOCGWINSZ, (char *)&shttyinfo.winsize); if (shttyinfo.winsize.ws_col) columns = shttyinfo.winsize.ws_col; + columns = COLUMNS; /* sanity */ if (shttyinfo.winsize.ws_row) lines = shttyinfo.winsize.ws_row; if (oldcols != columns) { *** zle_refresh.c 1996/08/12 01:39:05 2.13 --- zle_refresh.c 1996/08/23 04:17:41 *************** *** 66,72 **** int ln; static int lwinw = -1, lwinh = -1; /* last window width & height */ ! winw = COLUMNS; /* terminal width */ if (isset(SINGLELINEZLE) || termok != TERM_OK) winh = 1; else --- 66,73 ---- int ln; static int lwinw = -1, lwinh = -1; /* last window width & height */ ! columns = COLUMNS; /* sanity */ ! winw = COLUMNS; /* terminal width */ if (isset(SINGLELINEZLE) || termok != TERM_OK) winh = 1; else *************** *** 247,253 **** moveto(0, pptw); } clearf = clearflag; ! } else if (winw != COLUMNS) resetvideo(); /* now winw equals columns; now all width comparisons can be made to winw */ --- 248,254 ---- moveto(0, pptw); } clearf = clearflag; ! } else if (winw != columns) resetvideo(); /* now winw equals columns; now all width comparisons can be made to winw */ *************** *** 546,562 **** if (hasam && vcs == winw) { vln++, vcs = 1; putc(*nbuf[vln], shout); ! nl++; ! if (*ol) ! ol++; ! ccs = 1; } /* 3: main display loop - write out the buffer using whatever tricks we can */ for (;;) { ! if (*nl && nl[1] == ol[1]) /* skip only if second chars match */ ! /* skip past all matching characters */ for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ; if (!*nl) { --- 547,565 ---- if (hasam && vcs == winw) { vln++, vcs = 1; putc(*nbuf[vln], shout); ! if (!*ol) { ! ol = halloc(2); ! *ol = *nl; ! ol[1] = '\0'; ! } } /* 3: main display loop - write out the buffer using whatever tricks we can */ for (;;) { ! if (*nl && *ol && (nl[1] == ol[1] || (ccs + 1 == vcs))) ! /* if second characters match or the cursor is on the second character ! skip past all matching characters */ for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ; if (!*nl) { -- Geoff Wing [mason@primenet.com.au] PrimeNet - Internet Consultancy Web: http://www.primenet.com.au/ Facsimile: +61-3-9819 3788