diff options
author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2020-03-22 18:45:02 +0000 |
---|---|---|
committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2020-03-22 18:45:02 +0000 |
commit | 2b1e5a3d22ed4b66af3926e2034e2e8f16acc830 (patch) | |
tree | 5d0e9ecb0dfd8f01340f23262ae17267f66da3b2 /Src/utils.c | |
parent | aed0cb4408bffe2da89a25054b22144f616bdffe (diff) | |
download | zsh-2b1e5a3d22ed4b66af3926e2034e2e8f16acc830.tar.gz zsh-2b1e5a3d22ed4b66af3926e2034e2e8f16acc830.tar.xz zsh-2b1e5a3d22ed4b66af3926e2034e2e8f16acc830.zip |
45563: %z can be used for zlong in warnings and errors
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Src/utils.c b/Src/utils.c index 339404489..4d16de591 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -130,6 +130,7 @@ set_widearray(char *mb_array, Widechar_array wca) %l const char *, int C string of given length (null not required) %L long decimal value %d int decimal value + %z zlong decimal value %% (none) literal '%' %c int character at that codepoint %e int strerror() message (argument is typically 'errno') @@ -331,6 +332,14 @@ zerrmsg(FILE *file, const char *fmt, va_list ap) num = va_arg(ap, int); fprintf(file, "%d", num); break; + case 'z': + { + zlong znum = va_arg(ap, zlong); + char buf[DIGBUFSIZE]; + convbase(buf, znum, 10); + fputs(buf, file); + break; + } case '%': putc('%', file); break; |