version 1.37, 1997/12/17 16:03:05 |
version 1.38, 1998/02/17 23:22:56 |
|
|
long port; |
long port; |
struct passwd *pw = NULL; |
struct passwd *pw = NULL; |
char *cp, *ep, homedir[MAXPATHLEN]; |
char *cp, *ep, homedir[MAXPATHLEN]; |
|
char *outfile = NULL; |
int dumb_terminal = 0; |
int dumb_terminal = 0; |
int outfd = -1; |
|
|
|
sp = getservbyname("ftp", "tcp"); |
sp = getservbyname("ftp", "tcp"); |
if (sp == 0) |
if (sp == 0) |
|
|
if (isatty(fileno(ttyout)) && !dumb_terminal && foregroundproc()) |
if (isatty(fileno(ttyout)) && !dumb_terminal && foregroundproc()) |
progress = 1; /* progress bar on if tty is usable */ |
progress = 1; /* progress bar on if tty is usable */ |
|
|
if (!isatty(fileno(ttyout))) { |
while ((ch = getopt(argc, argv, "Aadegino:pPr:tvV")) != -1) { |
outfd = fileno(stdout); |
|
ttyout = stderr; |
|
} |
|
|
|
while ((ch = getopt(argc, argv, "AadeginpPr:tvV")) != -1) { |
|
switch (ch) { |
switch (ch) { |
case 'A': |
case 'A': |
activefallback = 0; |
activefallback = 0; |
|
|
autologin = 0; |
autologin = 0; |
break; |
break; |
|
|
|
case 'o': |
|
outfile = optarg; |
|
if (strcmp(outfile, "-") == 0) |
|
ttyout = stderr; |
|
break; |
|
|
case 'p': |
case 'p': |
passivemode = 1; |
passivemode = 1; |
activefallback = 0; |
activefallback = 0; |
|
|
if (argc > 0) { |
if (argc > 0) { |
if (strchr(argv[0], ':') != NULL) { |
if (strchr(argv[0], ':') != NULL) { |
anonftp = 1; /* Handle "automatic" transfers. */ |
anonftp = 1; /* Handle "automatic" transfers. */ |
rval = auto_fetch(argc, argv, outfd); |
rval = auto_fetch(argc, argv, outfile); |
if (rval >= 0) /* -1 == connected and cd-ed */ |
if (rval >= 0) /* -1 == connected and cd-ed */ |
exit(rval); |
exit(rval); |
} else { |
} else { |