mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 05:10:28 +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);
|
zfgetline(line, 256, tmout);
|
||||||
ptr = line;
|
ptr = line;
|
||||||
if (zfdrrrring || !isdigit(STOUC(*ptr)) || !isdigit(STOUC(ptr[1])) ||
|
if (zfdrrrring || !idigit(*ptr) || !idigit(ptr[1]) || !idigit(ptr[2])) {
|
||||||
!isdigit(STOUC(ptr[2]))) {
|
|
||||||
/* timeout, or not talking FTP. not really interested. */
|
/* timeout, or not talking FTP. not really interested. */
|
||||||
zcfinish = 2;
|
zcfinish = 2;
|
||||||
if (!zfclosing)
|
if (!zfclosing)
|
||||||
|
|
@ -914,7 +913,7 @@ zfopendata(char *name, union tcp_sockaddr *zdsockp, int *is_passivep)
|
||||||
goto bad_epsv;
|
goto bad_epsv;
|
||||||
while(ptr != end && *ptr == '0')
|
while(ptr != end && *ptr == '0')
|
||||||
ptr++;
|
ptr++;
|
||||||
if(ptr == end || (end-ptr) > 5 || !isdigit(STOUC(*ptr)))
|
if(ptr == end || (end-ptr) > 5 || !idigit(*ptr))
|
||||||
goto bad_epsv;
|
goto bad_epsv;
|
||||||
memcpy(portbuf, ptr, (end-ptr));
|
memcpy(portbuf, ptr, (end-ptr));
|
||||||
portbuf[end-ptr] = 0;
|
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.
|
* lastmsg already has the reply code expunged.
|
||||||
*/
|
*/
|
||||||
for (ptr = lastmsg; *ptr; ptr++)
|
for (ptr = lastmsg; *ptr; ptr++)
|
||||||
if (isdigit(STOUC(*ptr)))
|
if (idigit(*ptr))
|
||||||
break;
|
break;
|
||||||
if (sscanf(ptr, "%d,%d,%d,%d,%d,%d",
|
if (sscanf(ptr, "%d,%d,%d,%d,%d,%d",
|
||||||
nums, nums+1, nums+2, nums+3, nums+4, nums+5) != 6) {
|
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");
|
char *ptr = strstr(lastmsg, "bytes");
|
||||||
zfstatusp[zfsessno] |= ZFST_NOSZ|ZFST_TRSZ;
|
zfstatusp[zfsessno] |= ZFST_NOSZ|ZFST_TRSZ;
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
while (ptr > lastmsg && !isdigit(STOUC(*ptr)))
|
while (ptr > lastmsg && !idigit(*ptr))
|
||||||
ptr--;
|
ptr--;
|
||||||
while (ptr > lastmsg && isdigit(STOUC(ptr[-1])))
|
while (ptr > lastmsg && idigit(ptr[-1]))
|
||||||
ptr--;
|
ptr--;
|
||||||
if (isdigit(STOUC(*ptr))) {
|
if (idigit(*ptr)) {
|
||||||
zfstatusp[zfsessno] &= ~ZFST_NOSZ;
|
zfstatusp[zfsessno] &= ~ZFST_NOSZ;
|
||||||
if (getsize) {
|
if (getsize) {
|
||||||
off_t sz = zstrtol(ptr, NULL, 10);
|
off_t sz = zstrtol(ptr, NULL, 10);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ handle_digits(char *nam, char *argptr, fd_set *fdset, int *fdmax)
|
||||||
int fd;
|
int fd;
|
||||||
char *endptr;
|
char *endptr;
|
||||||
|
|
||||||
if (!isdigit(STOUC(*argptr))) {
|
if (!idigit(*argptr)) {
|
||||||
zwarnnam(nam, "expecting file descriptor: %s", argptr, 0);
|
zwarnnam(nam, "expecting file descriptor: %s", argptr, 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue