diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2007-10-22 10:22:16 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-10-22 10:22:16 +0000 |
| commit | 6567e77a4e474d9fcc90aeaf645598a79462f3c1 (patch) | |
| tree | 705323908ffee8cc22cfba297c7a4db368a53440 | |
| parent | 24006: (F) glob qualifier should unmetafy (diff) | |
| download | zsh-6567e77a4e474d9fcc90aeaf645598a79462f3c1.tar zsh-6567e77a4e474d9fcc90aeaf645598a79462f3c1.tar.gz zsh-6567e77a4e474d9fcc90aeaf645598a79462f3c1.tar.bz2 zsh-6567e77a4e474d9fcc90aeaf645598a79462f3c1.tar.lz zsh-6567e77a4e474d9fcc90aeaf645598a79462f3c1.tar.xz zsh-6567e77a4e474d9fcc90aeaf645598a79462f3c1.tar.zst zsh-6567e77a4e474d9fcc90aeaf645598a79462f3c1.zip | |
24007: prompt allocation and use of "shout"
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | Src/prompt.c | 4 | ||||
| -rw-r--r-- | Src/utils.c | 6 |
3 files changed, 9 insertions, 5 deletions
@@ -1,5 +1,9 @@ 2007-10-22 Peter Stephenson <pws@csr.com> + * 24007: Src/prompt.c, Src/utils.c: mildly suspicious things + found when looking at crash: prompt allocation length and use + of "shout". + * 24006: Src/glob.c: (F) glob qualifier needs to unmetafy. 2007-10-21 Clint Adams <clint@zsh.org> diff --git a/Src/prompt.c b/Src/prompt.c index b4b55a0ea..57af41b03 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -181,10 +181,10 @@ promptexpand(char *s, int ns, char *rs, char *Rs) bp1 = NULL; truncwidth = 0; putpromptchar(1, '\0'); - addbufspc(1); + addbufspc(2); if(dontcount) *bp++ = Outpar; - *bp = 0; + *bp = '\0'; if (!ns) { /* If zero, Inpar, Outpar and Nularg should be removed. */ for (bp = buf; *bp; ) { diff --git a/Src/utils.c b/Src/utils.c index bc04c3ec6..d01ec8634 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -1160,7 +1160,7 @@ preprompt(void) int period = getiparam("PERIOD"); int mailcheck = getiparam("MAILCHECK"); - if (isset(PROMPTSP) && isset(PROMPTCR) && !use_exit_printed) { + if (isset(PROMPTSP) && isset(PROMPTCR) && !use_exit_printed && shout) { /* The PROMPT_SP heuristic will move the prompt down to a new line * if there was any dangling output on the line (assuming the terminal * has automatic margins, but we try even if hasam isn't set). @@ -1284,7 +1284,7 @@ checkmailpath(char **s) checkmailpath(arr); popheap(); } - } else { + } else if (shout) { if (st.st_size && st.st_atime <= st.st_mtime && st.st_mtime > lastmailcheck) { if (!u) { @@ -2302,7 +2302,7 @@ spckword(char **s, int hist, int cmd, int ask) if (ask) { if (noquery(0)) { x = 'n'; - } else { + } else if (shout) { char *pptbuf; pptbuf = promptexpand(sprompt, 0, best, guess); zputs(pptbuf, shout); |
