(void)fclose(ftemp), ftemp = NULL;
(void)fclose(ftemp); ftemp = NULL;
remglob(argv, doswitch)        char *argv[];        int doswitch;{        char temp[MAXPATHLEN];        static char buf[MAXPATHLEN];        static FILE *ftemp = NULL;        static char **args;        int oldverbose, oldhash, fd;        char *cp, *mode;        if (!mflag) {                if (!doglob) {                        args = NULL;                }                else {                        if (ftemp) {                                (void)fclose(ftemp);                                ftemp = NULL;                        }                }                return (NULL);        }        if (!doglob) {                if (args == NULL)                        args = argv;                if ((cp = *++args) == NULL)                        args = NULL;                return (cp);        }        if (ftemp == NULL) {		int len;		if ((cp = getenv("TMPDIR")) == NULL)		    cp = _PATH_TMP;		len = strlen(cp);		if (len + sizeof(TMPFILE) + (cp[len-1] != '/') > sizeof(temp)) {			warnx("unable to create temporary file: %s",			    strerror(ENAMETOOLONG));			return (NULL);		}		(void)strcpy(temp, cp);		if (temp[len-1] != '/')			temp[len++] = '/';		(void)strcpy(&temp[len], TMPFILE);;                if ((fd = mkstemp(temp)) < 0) {                        warn("unable to create temporary file %s", temp);                        return (NULL);                }                close(fd);                oldverbose = verbose, verbose = 0;                oldhash = hash, hash = 0;                if (doswitch) {                        pswitch(!proxy);                }                for (mode = "w"; *++argv != NULL; mode = "a")                        recvrequest ("NLST", temp, *argv, mode, 0);                if (doswitch) {                        pswitch(!proxy);                }                verbose = oldverbose; hash = oldhash;                ftemp = fopen(temp, "r");                (void)unlink(temp);                if (ftemp == NULL) {                        puts("can't find list of remote files, oops");                        return (NULL);                }        }        if (fgets(buf, sizeof(buf), ftemp) == NULL) {                (void)fclose(ftemp), ftemp = NULL;                return (NULL);        }        if ((cp = strchr(buf, '\n')) != NULL)                *cp = '\0';        return (buf);}