mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 04:30:24 +02:00
Changed some isdigit() calls to use idigit().
This commit is contained in:
parent
dbac6846fa
commit
53d663f543
2 changed files with 7 additions and 8 deletions
|
@ -713,8 +713,7 @@ zfgetmsg(void)
|
|||
|
||||
zfgetline(line, 256, tmout);
|
||||
ptr = line;
|
||||
if (zfdrrrring || !isdigit(STOUC(*ptr)) || !isdigit(STOUC(ptr[1])) ||
|
||||
!isdigit(STOUC(ptr[2]))) {
|
||||
if (zfdrrrring || !idigit(*ptr) || !idigit(ptr[1]) || !idigit(ptr[2])) {
|
||||
/* timeout, or not talking FTP. not really interested. */
|
||||
zcfinish = 2;
|
||||
if (!zfclosing)
|
||||
|
@ -914,7 +913,7 @@ zfopendata(char *name, union tcp_sockaddr *zdsockp, int *is_passivep)
|
|||
goto bad_epsv;
|
||||
while(ptr != end && *ptr == '0')
|
||||
ptr++;
|
||||
if(ptr == end || (end-ptr) > 5 || !isdigit(STOUC(*ptr)))
|
||||
if(ptr == end || (end-ptr) > 5 || !idigit(*ptr))
|
||||
goto bad_epsv;
|
||||
memcpy(portbuf, ptr, (end-ptr));
|
||||
portbuf[end-ptr] = 0;
|
||||
|
@ -937,7 +936,7 @@ zfopendata(char *name, union tcp_sockaddr *zdsockp, int *is_passivep)
|
|||
* lastmsg already has the reply code expunged.
|
||||
*/
|
||||
for (ptr = lastmsg; *ptr; ptr++)
|
||||
if (isdigit(STOUC(*ptr)))
|
||||
if (idigit(*ptr))
|
||||
break;
|
||||
if (sscanf(ptr, "%d,%d,%d,%d,%d,%d",
|
||||
nums, nums+1, nums+2, nums+3, nums+4, nums+5) != 6) {
|
||||
|
@ -1103,11 +1102,11 @@ zfgetdata(char *name, char *rest, char *cmd, int getsize)
|
|||
char *ptr = strstr(lastmsg, "bytes");
|
||||
zfstatusp[zfsessno] |= ZFST_NOSZ|ZFST_TRSZ;
|
||||
if (ptr) {
|
||||
while (ptr > lastmsg && !isdigit(STOUC(*ptr)))
|
||||
while (ptr > lastmsg && !idigit(*ptr))
|
||||
ptr--;
|
||||
while (ptr > lastmsg && isdigit(STOUC(ptr[-1])))
|
||||
while (ptr > lastmsg && idigit(ptr[-1]))
|
||||
ptr--;
|
||||
if (isdigit(STOUC(*ptr))) {
|
||||
if (idigit(*ptr)) {
|
||||
zfstatusp[zfsessno] &= ~ZFST_NOSZ;
|
||||
if (getsize) {
|
||||
off_t sz = zstrtol(ptr, NULL, 10);
|
||||
|
|
|
@ -42,7 +42,7 @@ handle_digits(char *nam, char *argptr, fd_set *fdset, int *fdmax)
|
|||
int fd;
|
||||
char *endptr;
|
||||
|
||||
if (!isdigit(STOUC(*argptr))) {
|
||||
if (!idigit(*argptr)) {
|
||||
zwarnnam(nam, "expecting file descriptor: %s", argptr, 0);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue