diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/Modules/zselect.c | 13 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog index 3d4e96242..b46b55164 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-05-08 Peter Stephenson <pws@csr.com> + * Unposted: Src/Modules/zselect.c: remove an unused counter. + + * 17095: Src/Modules/zselect.c: wrong index when appending to a + value with zselect -A assoc. + * 17081: Src/Modules/zselect.c, Src/Modules/zselect.mdd, Doc/Zsh/mod_zselect.yo: zsh/zselect module provides zselect builtin as front-end to select system call. diff --git a/Src/Modules/zselect.c b/Src/Modules/zselect.c index 827a97797..2eee59d03 100644 --- a/Src/Modules/zselect.c +++ b/Src/Modules/zselect.c @@ -37,8 +37,7 @@ * Return 1 for error (after printing a message), 0 for OK. */ static int -handle_digits(char *nam, char *argptr, fd_set *fdset, int *fdcount, - int *fdmax) +handle_digits(char *nam, char *argptr, fd_set *fdset, int *fdmax) { int fd; char *endptr; @@ -54,7 +53,6 @@ handle_digits(char *nam, char *argptr, fd_set *fdset, int *fdcount, } FD_SET(fd, fdset); - (*fdcount)++; if (fd+1 > *fdmax) *fdmax = fd+1; return 0; @@ -67,7 +65,7 @@ static int bin_zselect(char *nam, char **args, char *ops, int func) { #ifdef HAVE_SELECT - int i, fd, fdsetind = 0, fdcount = 0, fdmax = 0; + int i, fd, fdsetind = 0, fdmax = 0, fdcount; fd_set fdset[3]; const char fdchar[3] = "rwe"; struct timeval tv, *tvptr = NULL; @@ -166,12 +164,11 @@ bin_zselect(char *nam, char **args, char *ops, int func) /* Digits following option without arguments are fd's. */ default: if (handle_digits(nam, argptr, fdset+fdsetind, - &fdcount, &fdmax)) + &fdmax)) return 1; } } - } else if (handle_digits(nam, argptr, fdset+fdsetind, &fdcount, - &fdmax)) + } else if (handle_digits(nam, argptr, fdset+fdsetind, &fdmax)) return 1; } @@ -220,7 +217,7 @@ bin_zselect(char *nam, char **args, char *ops, int func) strcpy(buf, data); for (ptr = buf; *ptr; ptr++) ; - *ptr++ = fdchar[1]; + *ptr++ = fdchar[i]; *ptr = '\0'; zsfree(data); *dataptr = ztrdup(buf); |