diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2009-03-03 22:11:37 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2009-03-03 22:11:37 +0000 |
commit | d60f73f7081a327fc6d6b9f988c763ab7b228f74 (patch) | |
tree | 3f5abcbd88b93a5f9b87867cb071f087b3516ec2 /Src/utils.c | |
parent | a3e73c8d05526b8c9d0735cfe747411567784a83 (diff) | |
download | zsh-d60f73f7081a327fc6d6b9f988c763ab7b228f74.tar.gz zsh-d60f73f7081a327fc6d6b9f988c763ab7b228f74.tar.xz zsh-d60f73f7081a327fc6d6b9f988c763ab7b228f74.zip |
26686: problem storing long $_ using VARARR()
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Src/utils.c b/Src/utils.c index fbe1eb223..7a983d48d 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -1340,9 +1340,13 @@ checkmailpath(char **s) fprintf(shout, "You have new mail.\n"); fflush(shout); } else { - VARARR(char, usav, underscoreused); + char *usav; + int uusav = underscoreused; - memcpy(usav, underscore, underscoreused); + usav = zalloc(underscoreused); + + if (usav) + memcpy(usav, underscore, underscoreused); setunderscore(*s); @@ -1353,7 +1357,10 @@ checkmailpath(char **s) fputc('\n', shout); fflush(shout); } - setunderscore(usav); + if (usav) { + setunderscore(usav); + zfree(usav, uusav); + } } } if (isset(MAILWARNING) && st.st_atime > st.st_mtime && |