diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2000-08-10 16:19:11 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-08-10 16:19:11 +0000 |
commit | f6ecbb7f4d74099a0d4b342996696159344f4235 (patch) | |
tree | b5da55d82acdc4ff4f3d8c0972be03a75a32837e /Src/params.c | |
parent | 4239b1243a4795fc6e7207151334cce03dafe44e (diff) | |
download | zsh-f6ecbb7f4d74099a0d4b342996696159344f4235.tar.gz zsh-f6ecbb7f4d74099a0d4b342996696159344f4235.tar.xz zsh-f6ecbb7f4d74099a0d4b342996696159344f4235.zip |
12581: C_BASES option
Diffstat (limited to 'Src/params.c')
-rw-r--r-- | Src/params.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c index 9ef3e61ca..1439e9af8 100644 --- a/Src/params.c +++ b/Src/params.c @@ -3045,7 +3045,12 @@ convbase(char *s, zlong v, int base) base = 10; if (base != 10) { - sprintf(s, "%d#", base); + if (isset(CBASES) && base == 16) + sprintf(s, "0x"); + else if (isset(CBASES) && base == 8 && isset(OCTALZEROES)) + sprintf(s, "0"); + else + sprintf(s, "%d#", base); s += strlen(s); } for (x = v; x; digs++) |