about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-22 13:08:37 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-22 13:08:37 +0000
commitf98b1581a4df286c310a2ef07f3af61eac9ea51d (patch)
tree9d4959898f51d25bd7f7c0f37e48e12469e04367 /Src/utils.c
parentfa7abedb5d6706c0ca3f3113013e87aa67939c51 (diff)
downloadzsh-f98b1581a4df286c310a2ef07f3af61eac9ea51d.tar.gz
zsh-f98b1581a4df286c310a2ef07f3af61eac9ea51d.tar.xz
zsh-f98b1581a4df286c310a2ef07f3af61eac9ea51d.zip
zsh-workers/7978
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c13
1 files changed, 5 insertions, 8 deletions
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 &&