From f98b1581a4df286c310a2ef07f3af61eac9ea51d Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 22 Sep 1999 13:08:37 +0000 Subject: zsh-workers/7978 --- Src/utils.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index 38468969e..f81ee8d5d 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -752,14 +752,11 @@ checkmailpath(char **s) fprintf(shout, "You have new mail.\n"); fflush(shout); } else { - VARARR(char, usav, underscorelen); - int sl = strlen(*s); + VARARR(char, usav, underscoreused); - if (sl >= underscorelen) { - zfree(underscore, underscorelen); - underscore = (char *) zalloc(underscorelen = sl + 32); - } - strcpy(underscore, *s); + memcpy(usav, underscore, underscoreused); + + setunderscore(*s); HEAPALLOC { u = dupstring(u); if (! parsestr(u)) { @@ -769,7 +766,7 @@ checkmailpath(char **s) fflush(shout); } } LASTALLOC; - strcpy(underscore, usav); + setunderscore(usav); } } if (isset(MAILWARNING) && st.st_atime > st.st_mtime && -- cgit 1.4.1