summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2005-11-30 16:49:44 +0000
committerWayne Davison <wayned@users.sourceforge.net>2005-11-30 16:49:44 +0000
commit37e08571a462e22e9f9b4670d9475885658fe44c (patch)
tree22acf508839d55a4acd126b51b3fd016e0da92e0
parent9483fd8a14564f9114a9a8e85c1d1b23d46f85c2 (diff)
downloadzsh-37e08571a462e22e9f9b4670d9475885658fe44c.tar.gz
zsh-37e08571a462e22e9f9b4670d9475885658fe44c.tar.xz
zsh-37e08571a462e22e9f9b4670d9475885658fe44c.zip
Fixed parsedigit() to have it use its arg instead of "lastchar".
-rw-r--r--Src/Zle/zle_misc.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 869e0a435..1cb113a2d 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -533,22 +533,19 @@ parsedigit(int inkey)
     inkey &= 0x7f;
 #endif
 
-    /* remember lastchar is not a wide character */
-    if (zmod.base > 10)
-    {
-	if (lastchar >= 'a' && lastchar < 'a' + zmod.base - 10)
-	    return lastchar - 'a' + 10;
-	else if (lastchar >= 'A' && lastchar < 'A' + zmod.base - 10)
-	    return lastchar - 'A' + 10;
-	else if (idigit(lastchar))
-	    return lastchar - '0';
-	else
-	    return -1;
-    }
-    else if (lastchar >= '0' && lastchar < '0' + zmod.base)
-	return lastchar - '0';
-    else
+    /* remember inkey is not a wide character */
+    if (zmod.base > 10) {
+	if (inkey >= 'a' && inkey < 'a' + zmod.base - 10)
+	    return inkey - 'a' + 10;
+	if (inkey >= 'A' && inkey < 'A' + zmod.base - 10)
+	    return inkey - 'A' + 10;
+	if (idigit(inkey))
+	    return inkey - '0';
 	return -1;
+    }
+    if (inkey >= '0' && inkey < '0' + zmod.base)
+	return inkey - '0';
+    return -1;
 }
 
 /**/