Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/usr.bin/ftp pullup 1.47->1.49 (lukem)
details: https://anonhg.NetBSD.org/src/rev/508290dbb50c
branches: netbsd-1-4
changeset: 468902:508290dbb50c
user: perry <perry%NetBSD.org@localhost>
date: Tue Jun 22 21:01:18 1999 +0000
description:
pullup 1.47->1.49 (lukem)
diffstat:
usr.bin/ftp/cmds.c | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diffs (75 lines):
diff -r 33ddecbf055a -r 508290dbb50c usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c Tue Jun 22 17:25:21 1999 +0000
+++ b/usr.bin/ftp/cmds.c Tue Jun 22 21:01:18 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmds.c,v 1.47 1999/03/08 03:09:08 lukem Exp $ */
+/* $NetBSD: cmds.c,v 1.47.2.1 1999/06/22 21:01:18 perry Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -8,6 +8,9 @@
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
* NASA Ames Research Center.
*
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -75,7 +78,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: cmds.c,v 1.47 1999/03/08 03:09:08 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.47.2.1 1999/06/22 21:01:18 perry Exp $");
#endif
#endif /* not lint */
@@ -1346,15 +1349,22 @@
}
n = command("USER %s", argv[1]);
if (n == CONTINUE) {
- if (argc < 3 )
- argv[2] = getpass("Password: "), argc++;
+ if (argc < 3) {
+ argv[2] = getpass("Password: ");
+ argc++;
+ }
n = command("PASS %s", argv[2]);
}
if (n == CONTINUE) {
if (argc < 4) {
(void)fputs("Account: ", ttyout);
(void)fflush(ttyout);
- (void)fgets(acct, sizeof(acct) - 1, stdin);
+ if (fgets(acct, sizeof(acct) - 1, stdin) == NULL) {
+ fprintf(ttyout,
+ "\nEOF received; login aborted.\n");
+ code = -1;
+ return;
+ }
acct[strlen(acct) - 1] = '\0';
argv[3] = acct; argc++;
}
@@ -2252,7 +2262,7 @@
int argc;
char *argv[];
{
- int ohash, orestart_point, overbose;
+ int ohash, orestart_point, overbose, len;
char *p, *pager, *oldargv1;
if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) {
@@ -2268,8 +2278,9 @@
p = getenv("PAGER");
if (p == NULL)
p = PAGER;
- pager = xmalloc(strlen(p) + 2);
- (void)sprintf(pager, "|%s", p);
+ len = strlen(p) + 2;
+ pager = xmalloc(len);
+ (void)snprintf(pager, len, "|%s", p);
ohash = hash;
orestart_point = restart_point;
Home |
Main Index |
Thread Index |
Old Index