summaryrefslogtreecommitdiff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-05-19 18:22:50 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-05-19 18:22:50 +0000
commit8d17d2f02dfa2b0bb4c19efcf52854fbb7fa19e5 (patch)
tree65bf9ac762900c25f7aa4b7ea88123bd6517254d /Src/subst.c
parente20600c8a404d35bd4b4c02976ce08f5b166f415 (diff)
downloadzsh-8d17d2f02dfa2b0bb4c19efcf52854fbb7fa19e5.tar.gz
zsh-8d17d2f02dfa2b0bb4c19efcf52854fbb7fa19e5.zip
11467: [#<base>] syntax for output base
zsh-users/3071: compdump tweak to avoid // in path
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 94a1222d8..beb99b5ee 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -1964,10 +1964,13 @@ arithsubst(char *a, char **bptr, char *rest)
singsub(&a);
v = matheval(a);
- if (v.type & MN_FLOAT)
+ if ((v.type & MN_FLOAT) && !outputradix)
b = convfloat(v.u.d, 0, 0, NULL);
- else
- convbase(buf, v.u.l, 0);
+ else {
+ if (v.type & MN_FLOAT)
+ v.u.l = (zlong) v.u.d;
+ convbase(buf, v.u.l, outputradix);
+ }
t = *bptr = (char *) hcalloc(strlen(*bptr) + strlen(b) +
strlen(rest) + 1);
t--;