about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-26 01:07:50 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-26 01:07:50 +0000
commit505c14ca0522dc4f5be90e7ed7c0efa60cfce91e (patch)
treeb408d73f6f1b4527b0d291029db8156e5e638844 /Src/utils.c
parent475aca3cb2d779f7a8c9dfbf05afa7d94250a46c (diff)
downloadzsh-505c14ca0522dc4f5be90e7ed7c0efa60cfce91e.tar.gz
zsh-505c14ca0522dc4f5be90e7ed7c0efa60cfce91e.tar.xz
zsh-505c14ca0522dc4f5be90e7ed7c0efa60cfce91e.zip
zsh-workers/8779
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Src/utils.c b/Src/utils.c
index b13b2e037..c4789630d 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -76,7 +76,7 @@ zwarn(const char *fmt, const char *str, int num)
      */
     nicezputs((isset(SHINSTDIN) && !locallevel) ? "zsh" :
 	      scriptname ? scriptname : argzero, stderr);
-    fputs(": ", stderr);
+    fputc((unsigned char)':', stderr);
     zerrmsg(fmt, str, num);
 }
 
@@ -89,11 +89,11 @@ zwarnnam(const char *cmd, const char *fmt, const char *str, int num)
     trashzle();
     if (unset(SHINSTDIN) || locallevel) {
 	nicezputs(scriptname ? scriptname : argzero, stderr);
-	fputs(": ", stderr);
+	fputc((unsigned char)':', stderr);
     }
     if (cmd) {
 	nicezputs(cmd, stderr);
-	fputs(": ", stderr);
+	fputc((unsigned char)':', stderr);
     }
     zerrmsg(fmt, str, num);
 }
@@ -102,6 +102,11 @@ zwarnnam(const char *cmd, const char *fmt, const char *str, int num)
 void
 zerrmsg(const char *fmt, const char *str, int num)
 {
+    if ((unset(SHINSTDIN) || locallevel) && lineno)
+	fprintf(stderr, "%ld: ", (long)lineno);
+    else
+	fputc((unsigned char)' ', stderr);
+
     while (*fmt)
 	if (*fmt == '%') {
 	    fmt++;
@@ -149,10 +154,7 @@ zerrmsg(const char *fmt, const char *str, int num)
 	    putc(*fmt == Meta ? *++fmt ^ 32 : *fmt, stderr);
 	    fmt++;
 	}
-    if ((unset(SHINSTDIN) || locallevel) && lineno)
-	fprintf(stderr, " [%ld]\n", (long)lineno);
-    else
-	putc('\n', stderr);
+    putc('\n', stderr);
     fflush(stderr);
 }