projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix problem building own hostent
[unix-history]
/
usr
/
src
/
usr.bin
/
ftp
/
main.c
diff --git
a/usr/src/usr.bin/ftp/main.c
b/usr/src/usr.bin/ftp/main.c
index
554f45c
..
fad94de
100644
(file)
--- a/
usr/src/usr.bin/ftp/main.c
+++ b/
usr/src/usr.bin/ftp/main.c
@@
-1,6
+1,18
@@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
#ifndef lint
#ifndef lint
-static char sccsid[] = "@(#)main.c 4.7 (Berkeley) %G%";
-#endif
+char copyright[] =
+"@(#) Copyright (c) 1983 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif not lint
+
+#ifndef lint
+static char sccsid[] = "@(#)main.c 5.1 (Berkeley) %G%";
+#endif not lint
/*
* FTP User Program -- Command Interface.
/*
* FTP User Program -- Command Interface.
@@
-101,14
+113,14
@@
main(argc, argv)
if (argc > 0) {
if (setjmp(toplevel))
exit(0);
if (argc > 0) {
if (setjmp(toplevel))
exit(0);
- sig
set
(SIGINT, intr);
- sig
set
(SIGPIPE, lostpeer);
+ sig
nal
(SIGINT, intr);
+ sig
nal
(SIGPIPE, lostpeer);
setpeer(argc + 1, argv - 1);
}
top = setjmp(toplevel) == 0;
if (top) {
setpeer(argc + 1, argv - 1);
}
top = setjmp(toplevel) == 0;
if (top) {
- sig
set
(SIGINT, intr);
- sig
set
(SIGPIPE, lostpeer);
+ sig
nal
(SIGINT, intr);
+ sig
nal
(SIGPIPE, lostpeer);
}
for (;;) {
cmdscanner(top);
}
for (;;) {
cmdscanner(top);
@@
-178,8
+190,15
@@
cmdscanner(top)
printf("ftp> ");
fflush(stdout);
}
printf("ftp> ");
fflush(stdout);
}
- if (gets(line) == 0)
+ if (gets(line) == 0) {
+ if (feof(stdin)) {
+ if (!fromatty)
+ quit();
+ clearerr(stdin);
+ putchar('\n');
+ }
break;
break;
+ }
if (line[0] == 0)
break;
makeargv();
if (line[0] == 0)
break;
makeargv();