diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-07-03 13:16:46 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-07-03 13:16:46 +0000 |
commit | 7c670f1e6a0e154f0b1a2d4b6eed0e71c9404b56 (patch) | |
tree | 9bb85bcd27410e1b752c8550f487165d71dc8aca /Src/utils.c | |
parent | b09922bb063ddf44c7850b182fec4795fbe1ae90 (diff) | |
download | zsh-7c670f1e6a0e154f0b1a2d4b6eed0e71c9404b56.tar.gz zsh-7c670f1e6a0e154f0b1a2d4b6eed0e71c9404b56.tar.xz zsh-7c670f1e6a0e154f0b1a2d4b6eed0e71c9404b56.zip |
zsh-3.1.5-pws-25 dot-zsh-199907031715
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Src/utils.c b/Src/utils.c index 16dbe9229..a409ab03c 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -62,9 +62,10 @@ zerr(const char *fmt, const char *str, int num) /* * scriptname is set when sourcing scripts, so that we get the * correct name instead of the generic name of whatever - * program/script is running. + * program/script is running. It's also set in shell functions, + * so test locallevel, too. */ - nicezputs(isset(SHINSTDIN) ? "zsh" : + nicezputs((isset(SHINSTDIN) && !locallevel) ? "zsh" : scriptname ? scriptname : argzero, stderr); fputs(": ", stderr); zerrnam(NULL, fmt, str, num); @@ -79,7 +80,7 @@ zerrnam(const char *cmd, const char *fmt, const char *str, int num) return; errflag = 1; trashzle(); - if(unset(SHINSTDIN)) { + if (unset(SHINSTDIN) || locallevel) { nicezputs(scriptname ? scriptname : argzero, stderr); fputs(": ", stderr); } @@ -133,7 +134,7 @@ zerrnam(const char *cmd, const char *fmt, const char *str, int num) putc(*fmt == Meta ? *++fmt ^ 32 : *fmt, stderr); fmt++; } - if (unset(SHINSTDIN) && lineno) + if ((unset(SHINSTDIN) || locallevel) && lineno) fprintf(stderr, " [%ld]\n", (long)lineno); else putc('\n', stderr); @@ -2133,7 +2134,12 @@ mkarray(char *s) void zbeep(void) { - if (isset(BEEP)) + char *vb; + if ((vb = getsparam("ZBEEP"))) { + int len; + vb = getkeystring(vb, &len, 2, NULL); + write(SHTTY, vb, len); + } else if (isset(BEEP)) write(SHTTY, "\07", 1); } |