tab cleanup

This commit is contained in:
lukem 2005-05-19 03:14:52 +00:00
parent dc6635b518
commit 943e24eb27

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.125 2005/05/19 03:05:04 lukem Exp $ */
/* $NetBSD: util.c,v 1.126 2005/05/19 03:14:52 lukem Exp $ */
/*-
* Copyright (c) 1997-2005 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: util.c,v 1.125 2005/05/19 03:05:04 lukem Exp $");
__RCSID("$NetBSD: util.c,v 1.126 2005/05/19 03:14:52 lukem Exp $");
#endif /* not lint */
/*
@ -532,64 +532,64 @@ another(int *pargc, char ***pargv, const char *prompt)
char *
remglob(char *argv[], int doswitch, const char **errbuf)
{
static char buf[MAXPATHLEN];
static FILE *ftemp = NULL;
static char **args;
char temp[MAXPATHLEN];
int oldverbose, oldhash, oldprogress, fd;
char *cp, *mode;
static char buf[MAXPATHLEN];
static FILE *ftemp = NULL;
static char **args;
char temp[MAXPATHLEN];
int oldverbose, oldhash, oldprogress, fd;
char *cp, *mode;
size_t len;
if (!mflag || !connected) {
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) {
if (!mflag || !connected) {
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) {
len = strlcpy(temp, tmpdir, sizeof(temp));
if (temp[len - 1] != '/')
(void)strlcat(temp, "/", sizeof(temp));
(void)strlcat(temp, TMPFILE, sizeof(temp));
if ((fd = mkstemp(temp)) < 0) {
warn("unable to create temporary file %s", temp);
return (NULL);
}
close(fd);
oldverbose = verbose;
if ((fd = mkstemp(temp)) < 0) {
warn("unable to create temporary file %s", temp);
return (NULL);
}
close(fd);
oldverbose = verbose;
verbose = (errbuf != NULL) ? -1 : 0;
oldhash = hash;
oldhash = hash;
oldprogress = progress;
hash = 0;
hash = 0;
progress = 0;
if (doswitch)
pswitch(!proxy);
for (mode = "w"; *++argv != NULL; mode = "a")
recvrequest("NLST", temp, *argv, mode, 0, 0);
if (doswitch)
pswitch(!proxy);
for (mode = "w"; *++argv != NULL; mode = "a")
recvrequest("NLST", temp, *argv, mode, 0, 0);
if ((code / 100) != COMPLETE) {
if (errbuf != NULL)
*errbuf = reply_string;
}
if (doswitch)
pswitch(!proxy);
verbose = oldverbose;
if (doswitch)
pswitch(!proxy);
verbose = oldverbose;
hash = oldhash;
progress = oldprogress;
ftemp = fopen(temp, "r");
(void)unlink(temp);
if (ftemp == NULL) {
ftemp = fopen(temp, "r");
(void)unlink(temp);
if (ftemp == NULL) {
if (errbuf == NULL)
fputs(
"can't find list of remote files, oops.\n",
@ -597,17 +597,17 @@ remglob(char *argv[], int doswitch, const char **errbuf)
else
*errbuf =
"can't find list of remote files, oops.";
return (NULL);
}
}
if (fgets(buf, sizeof(buf), ftemp) == NULL) {
(void)fclose(ftemp);
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);
return (NULL);
}
if ((cp = strchr(buf, '\n')) != NULL)
*cp = '\0';
return (buf);
}
/*