From: Geoff Wing <mason@primenet.com.au>
To: zsh-workers@math.gatech.edu
Subject: bodgy COLUMNS coredump
Date: Fri, 23 Aug 1996 14:32:08 +1000 (EST) [thread overview]
Message-ID: <199608230432.OAA04762@coral.primenet.com.au> (raw)
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
next reply other threads:[~1996-08-23 4:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-08-23 4:32 Geoff Wing [this message]
1996-08-23 6:27 ` Bart Schaefer
1996-08-23 4:37 Geoff Wing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199608230432.OAA04762@coral.primenet.com.au \
--to=mason@primenet.com.au \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).