mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-20 16:01:04 +02:00
Fixed parsedigit() to have it use its arg instead of "lastchar".
This commit is contained in:
parent
9483fd8a14
commit
37e08571a4
1 changed files with 12 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**/
|
||||
|
|
Loading…
Reference in a new issue