about summary refs log tree commit diff
path: root/Src/params.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/params.c
parente20600c8a404d35bd4b4c02976ce08f5b166f415 (diff)
downloadzsh-8d17d2f02dfa2b0bb4c19efcf52854fbb7fa19e5.tar.gz
zsh-8d17d2f02dfa2b0bb4c19efcf52854fbb7fa19e5.tar.xz
zsh-8d17d2f02dfa2b0bb4c19efcf52854fbb7fa19e5.zip
11467: [#<base>] syntax for output base
zsh-users/3071: compdump tweak to avoid // in path
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Src/params.c b/Src/params.c
index 6ccfd9307..8c39ec2ac 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1577,9 +1577,11 @@ setnumvalue(Value v, mnumber val)
     switch (PM_TYPE(v->pm->flags)) {
     case PM_SCALAR:
     case PM_ARRAY:
-	if (val.type & MN_INTEGER)
-	    convbase(p = buf, val.u.l, 0);
-	else
+	if ((val.type & MN_INTEGER) || outputradix) {
+	    if (!(val.type & MN_INTEGER))
+		val.u.l = (zlong) val.u.d;
+	    convbase(p = buf, val.u.l, outputradix);
+	} else
 	    p = convfloat(val.u.d, 0, 0, NULL);
 	setstrvalue(v, ztrdup(p));
 	break;
@@ -1909,9 +1911,10 @@ setnparam(char *s, mnumber val)
 	pm = createparam(t, (val.type & MN_INTEGER) ? PM_INTEGER
 			 : PM_FFLOAT);
 	DPUTS(!pm, "BUG: parameter not created");
-	if (val.type & MN_INTEGER)
+	if (val.type & MN_INTEGER) {
+	    pm->ct = outputradix;
 	    pm->u.val = val.u.l;
-	else
+	} else
 	    pm->u.dval = val.u.d;
 	return pm;
     }