=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/cmds.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/ftp/cmds.c 1997/04/16 05:02:39 1.19 --- src/usr.bin/ftp/cmds.c 1997/04/23 20:32:57 1.20 *************** *** 1,4 **** ! /* $OpenBSD: cmds.c,v 1.19 1997/04/16 05:02:39 millert Exp $ */ /* $NetBSD: cmds.c,v 1.23 1997/04/14 09:09:15 lukem Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: cmds.c,v 1.20 1997/04/23 20:32:57 deraadt Exp $ */ /* $NetBSD: cmds.c,v 1.23 1997/04/14 09:09:15 lukem Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else ! static char rcsid[] = "$OpenBSD: cmds.c,v 1.19 1997/04/16 05:02:39 millert Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else ! static char rcsid[] = "$OpenBSD: cmds.c,v 1.20 1997/04/23 20:32:57 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 95,112 **** if (argc > 2) { char *sep; ! printf("usage: %s [", argv[0]); sep = " "; for (p = types; p->t_name; p++) { ! printf("%s%s", sep, p->t_name); sep = " | "; } ! puts(" ]"); code = -1; return; } if (argc < 2) { ! printf("Using %s mode to transfer files.\n", typename); code = 0; return; } --- 95,112 ---- if (argc > 2) { char *sep; ! fprintf(ttyout, "usage: %s [", argv[0]); sep = " "; for (p = types; p->t_name; p++) { ! fprintf(ttyout, "%s%s", sep, p->t_name); sep = " | "; } ! fputs(" ]\n", ttyout); code = -1; return; } if (argc < 2) { ! fprintf(ttyout, "Using %s mode to transfer files.\n", typename); code = 0; return; } *************** *** 114,120 **** if (strcmp(argv[1], p->t_name) == 0) break; if (p->t_name == 0) { ! printf("%s: unknown mode.\n", argv[1]); code = -1; return; } --- 114,120 ---- if (strcmp(argv[1], p->t_name) == 0) break; if (p->t_name == 0) { ! fprintf(ttyout, "%s: unknown mode.\n", argv[1]); code = -1; return; } *************** *** 220,226 **** char *argv[]; { ! printf("We only support %s mode, sorry.\n", modename); code = -1; } --- 220,226 ---- char *argv[]; { ! fprintf(ttyout, "We only support %s mode, sorry.\n", modename); code = -1; } *************** *** 234,240 **** char *argv[]; { ! printf("We only support %s format, sorry.\n", formname); code = -1; } --- 234,240 ---- char *argv[]; { ! fprintf(ttyout, "We only support %s format, sorry.\n", formname); code = -1; } *************** *** 248,254 **** char *argv[]; { ! printf("We only support %s structure, sorry.\n", structname); code = -1; } --- 248,254 ---- char *argv[]; { ! fprintf(ttyout, "We only support %s structure, sorry.\n", structname); code = -1; } *************** *** 273,279 **** goto usage; if ((argc < 3 && !another(&argc, &argv, "remote-file")) || argc > 3) { usage: ! printf("usage: %s local-file [ remote-file ]\n", argv[0]); code = -1; return; } --- 273,279 ---- goto usage; if ((argc < 3 && !another(&argc, &argv, "remote-file")) || argc > 3) { usage: ! fprintf(ttyout, "usage: %s local-file [ remote-file ]\n", argv[0]); code = -1; return; } *************** *** 315,321 **** char *tp; if (argc < 2 && !another(&argc, &argv, "local-files")) { ! printf("usage: %s local-files\n", argv[0]); code = -1; return; } --- 315,321 ---- char *tp; if (argc < 2 && !another(&argc, &argv, "local-files")) { ! fprintf(ttyout, "usage: %s local-files\n", argv[0]); code = -1; return; } *************** *** 464,470 **** goto usage; if ((argc < 3 && !another(&argc, &argv, "local-file")) || argc > 3) { usage: ! printf("usage: %s remote-file [ local-file ]\n", argv[0]); code = -1; return (0); } --- 464,470 ---- goto usage; if ((argc < 3 && !another(&argc, &argv, "local-file")) || argc > 3) { usage: ! fprintf(ttyout, "usage: %s remote-file [ local-file ]\n", argv[0]); code = -1; return (0); } *************** *** 535,542 **** int ointer, oconf; alarmtimer(0); ! putchar('\n'); ! (void)fflush(stdout); if (mflag && fromatty) { ointer = interactive; oconf = confirmrest; --- 535,542 ---- int ointer, oconf; alarmtimer(0); ! putc('\n', ttyout); ! (void)fflush(ttyout); if (mflag && fromatty) { ointer = interactive; oconf = confirmrest; *************** *** 567,573 **** char *cp, *tp, *tp2, tmpbuf[MAXPATHLEN]; if (argc < 2 && !another(&argc, &argv, "remote-files")) { ! printf("usage: %s remote-files\n", argv[0]); code = -1; return; } --- 567,573 ---- char *cp, *tp, *tp2, tmpbuf[MAXPATHLEN]; if (argc < 2 && !another(&argc, &argv, "remote-files")) { ! fprintf(ttyout, "usage: %s remote-files\n", argv[0]); code = -1; return; } *************** *** 630,682 **** int i; if (connected) ! printf("Connected %sto %s.\n", connected == -1 ? "and logged in" : "", hostname); else ! puts("Not connected."); if (!proxy) { pswitch(1); if (connected) { ! printf("Connected for proxy commands to %s.\n", hostname); } else { ! puts("No proxy connection."); } pswitch(0); } ! printf("Passive mode: %s.\n", onoff(passivemode)); ! printf("Mode: %s; Type: %s; Form: %s; Structure: %s.\n", modename, typename, formname, structname); ! printf("Verbose: %s; Bell: %s; Prompting: %s; Globbing: %s.\n", onoff(verbose), onoff(bell), onoff(interactive), onoff(doglob)); ! printf("Store unique: %s; Receive unique: %s.\n", onoff(sunique), onoff(runique)); ! printf("Preserve modification times: %s.\n", onoff(preserve)); ! printf("Case: %s; CR stripping: %s.\n", onoff(mcase), onoff(crflag)); if (ntflag) { ! printf("Ntrans: (in) %s (out) %s\n", ntin, ntout); } else { ! puts("Ntrans: off."); } if (mapflag) { ! printf("Nmap: (in) %s (out) %s\n", mapin, mapout); } else { ! puts("Nmap: off."); } ! printf("Hash mark printing: %s; Mark count: %d; Progress bar: %s.\n", onoff(hash), mark, onoff(progress)); ! printf("Use of PORT cmds: %s.\n", onoff(sendport)); #ifndef SMALL ! printf("Command line editing: %s.\n", onoff(editing)); #endif /* !SMALL */ if (macnum > 0) { ! puts("Macros:"); for (i=0; i 0) { ! fputs("Macros:", ttyout); for (i=0; i 2) { ! printf("usage: %s [ on | off | debuglevel ]\n", argv[0]); code = -1; return; } else if (argc == 2) { --- 878,884 ---- int val; if (argc > 2) { ! fprintf(ttyout, "usage: %s [ on | off | debuglevel ]\n", argv[0]); code = -1; return; } else if (argc == 2) { *************** *** 889,895 **** else { val = atoi(argv[1]); if (val < 0) { ! printf("%s: bad debugging value.\n", argv[1]); code = -1; return; } --- 889,895 ---- else { val = atoi(argv[1]); if (val < 0) { ! fprintf(ttyout, "%s: bad debugging value.\n", argv[1]); code = -1; return; } *************** *** 901,907 **** options |= SO_DEBUG; else options &= ~SO_DEBUG; ! printf("Debugging %s (debug=%d).\n", onoff(debug), debug); code = debug > 0; } --- 901,907 ---- options |= SO_DEBUG; else options &= ~SO_DEBUG; ! fprintf(ttyout, "Debugging %s (debug=%d).\n", onoff(debug), debug); code = debug > 0; } *************** *** 918,931 **** if ((argc < 2 && !another(&argc, &argv, "remote-directory")) || argc > 2) { ! printf("usage: %s remote-directory\n", argv[0]); code = -1; return; } r = command("CWD %s", argv[1]); if (r == ERROR && code == 500) { if (verbose) ! puts("CWD command not recognized, trying XCWD."); r = command("XCWD %s", argv[1]); } if (r == COMPLETE) --- 918,931 ---- if ((argc < 2 && !another(&argc, &argv, "remote-directory")) || argc > 2) { ! fprintf(ttyout, "usage: %s remote-directory\n", argv[0]); code = -1; return; } r = command("CWD %s", argv[1]); if (r == ERROR && code == 500) { if (verbose) ! fputs("CWD command not recognized, trying XCWD.\n", ttyout); r = command("XCWD %s", argv[1]); } if (r == COMPLETE) *************** *** 946,952 **** if (argc < 2) argc++, argv[1] = home; if (argc != 2) { ! printf("usage: %s local-directory\n", argv[0]); code = -1; return; } --- 946,952 ---- if (argc < 2) argc++, argv[1] = home; if (argc != 2) { ! fprintf(ttyout, "usage: %s local-directory\n", argv[0]); code = -1; return; } *************** *** 960,966 **** return; } if (getcwd(buf, sizeof(buf)) != NULL) ! printf("Local directory now %s\n", buf); else warn("getcwd: %s", argv[1]); code = 0; --- 960,966 ---- return; } if (getcwd(buf, sizeof(buf)) != NULL) ! fprintf(ttyout, "Local directory now %s\n", buf); else warn("getcwd: %s", argv[1]); code = 0; *************** *** 976,982 **** { if ((argc < 2 && !another(&argc, &argv, "remote-file")) || argc > 2) { ! printf("usage: %s remote-file\n", argv[0]); code = -1; return; } --- 976,982 ---- { if ((argc < 2 && !another(&argc, &argv, "remote-file")) || argc > 2) { ! fprintf(ttyout, "usage: %s remote-file\n", argv[0]); code = -1; return; } *************** *** 996,1002 **** char *cp; if (argc < 2 && !another(&argc, &argv, "remote-files")) { ! printf("usage: %s remote-files\n", argv[0]); code = -1; return; } --- 996,1002 ---- char *cp; if (argc < 2 && !another(&argc, &argv, "remote-files")) { ! fprintf(ttyout, "usage: %s remote-files\n", argv[0]); code = -1; return; } *************** *** 1038,1044 **** goto usage; if ((argc < 3 && !another(&argc, &argv, "to-name")) || argc > 3) { usage: ! printf("usage: %s from-name to-name\n", argv[0]); code = -1; return; } --- 1038,1044 ---- goto usage; if ((argc < 3 && !another(&argc, &argv, "to-name")) || argc > 3) { usage: ! fprintf(ttyout, "usage: %s from-name to-name\n", argv[0]); code = -1; return; } *************** *** 1062,1068 **** if (argc < 3) argc++, argv[2] = "-"; if (argc > 3) { ! printf("usage: %s remote-directory local-file\n", argv[0]); code = -1; return; } --- 1062,1068 ---- if (argc < 3) argc++, argv[2] = "-"; if (argc > 3) { ! fprintf(ttyout, "usage: %s remote-directory local-file\n", argv[0]); code = -1; return; } *************** *** 1080,1086 **** recvrequest(cmd, argv[2], argv[1], "w", 0); /* flush results in case commands are coming from a pipe */ ! fflush(stdout); } /* --- 1080,1086 ---- recvrequest(cmd, argv[2], argv[1], "w", 0); /* flush results in case commands are coming from a pipe */ ! fflush(ttyout); } /* *************** *** 1101,1107 **** goto usage; if (argc < 3 && !another(&argc, &argv, "local-file")) { usage: ! printf("usage: %s remote-files local-file\n", argv[0]); code = -1; return; } --- 1101,1107 ---- goto usage; if (argc < 3 && !another(&argc, &argv, "local-file")) { usage: ! fprintf(ttyout, "usage: %s remote-files local-file\n", argv[0]); code = -1; return; } *************** *** 1167,1174 **** if (strcmp(namep, "sh") != 0) shellnam[0] = '+'; if (debug) { ! puts(shell); ! (void)fflush(stdout); } if (argc > 1) { execl(shell, shellnam, "-c", altarg, (char *)0); --- 1167,1175 ---- if (strcmp(namep, "sh") != 0) shellnam[0] = '+'; if (debug) { ! fputs(shell, ttyout); ! fputs("\n", ttyout); ! (void)fflush(ttyout); } if (argc > 1) { execl(shell, shellnam, "-c", altarg, (char *)0); *************** *** 1208,1214 **** if (argc < 2) (void)another(&argc, &argv, "username"); if (argc < 2 || argc > 4) { ! printf("usage: %s username [password] [account]\n", argv[0]); code = -1; return; } --- 1209,1215 ---- if (argc < 2) (void)another(&argc, &argv, "username"); if (argc < 2 || argc > 4) { ! fprintf(ttyout, "usage: %s username [password] [account]\n", argv[0]); code = -1; return; } *************** *** 1220,1227 **** } if (n == CONTINUE) { if (argc < 4) { ! (void)fputs("Account: ", stdout); ! (void)fflush(stdout); (void)fgets(acct, sizeof(acct) - 1, stdin); acct[strlen(acct) - 1] = '\0'; argv[3] = acct; argc++; --- 1221,1228 ---- } if (n == CONTINUE) { if (argc < 4) { ! (void)fputs("Account: ", ttyout); ! (void)fflush(ttyout); (void)fgets(acct, sizeof(acct) - 1, stdin); acct[strlen(acct) - 1] = '\0'; argv[3] = acct; argc++; *************** *** 1230,1236 **** aflag++; } if (n != COMPLETE) { ! puts("Login failed."); return; } if (!aflag && argc == 4) { --- 1231,1237 ---- aflag++; } if (n != COMPLETE) { ! fputs("Login failed.\n", ttyout); return; } if (!aflag && argc == 4) { *************** *** 1255,1261 **** */ verbose = 1; if (command("PWD") == ERROR && code == 500) { ! puts("PWD command not recognized, trying XPWD."); (void)command("XPWD"); } verbose = oldverbose; --- 1256,1262 ---- */ verbose = 1; if (command("PWD") == ERROR && code == 500) { ! fputs("PWD command not recognized, trying XPWD.\n", ttyout); (void)command("XPWD"); } verbose = oldverbose; *************** *** 1272,1278 **** char buf[MAXPATHLEN]; if (getcwd(buf, sizeof(buf)) != NULL) ! printf("Local directory %s\n", buf); else warn("getcwd"); code = 0; --- 1273,1279 ---- char buf[MAXPATHLEN]; if (getcwd(buf, sizeof(buf)) != NULL) ! fprintf(ttyout, "Local directory %s\n", buf); else warn("getcwd"); code = 0; *************** *** 1289,1301 **** if ((argc < 2 && !another(&argc, &argv, "directory-name")) || argc > 2) { ! printf("usage: %s directory-name\n", argv[0]); code = -1; return; } if (command("MKD %s", argv[1]) == ERROR && code == 500) { if (verbose) ! puts("MKD command not recognized, trying XMKD."); (void)command("XMKD %s", argv[1]); } } --- 1290,1302 ---- if ((argc < 2 && !another(&argc, &argv, "directory-name")) || argc > 2) { ! fprintf(ttyout, "usage: %s directory-name\n", argv[0]); code = -1; return; } if (command("MKD %s", argv[1]) == ERROR && code == 500) { if (verbose) ! fputs("MKD command not recognized, trying XMKD.\n", ttyout); (void)command("XMKD %s", argv[1]); } } *************** *** 1311,1323 **** if ((argc < 2 && !another(&argc, &argv, "directory-name")) || argc > 2) { ! printf("usage: %s directory-name\n", argv[0]); code = -1; return; } if (command("RMD %s", argv[1]) == ERROR && code == 500) { if (verbose) ! puts("RMD command not recognized, trying XRMD."); (void)command("XRMD %s", argv[1]); } } --- 1312,1324 ---- if ((argc < 2 && !another(&argc, &argv, "directory-name")) || argc > 2) { ! fprintf(ttyout, "usage: %s directory-name\n", argv[0]); code = -1; return; } if (command("RMD %s", argv[1]) == ERROR && code == 500) { if (verbose) ! fputs("RMD command not recognized, trying XRMD.\n", ttyout); (void)command("XRMD %s", argv[1]); } } *************** *** 1332,1338 **** { if (argc < 2 && !another(&argc, &argv, "command line to send")) { ! printf("usage: %s line-to-send\n", argv[0]); code = -1; return; } --- 1333,1339 ---- { if (argc < 2 && !another(&argc, &argv, "command line to send")) { ! fprintf(ttyout, "usage: %s line-to-send\n", argv[0]); code = -1; return; } *************** *** 1351,1357 **** { if (argc < 2 && !another(&argc, &argv, "arguments to SITE command")) { ! printf("usage: %s line-to-send\n", argv[0]); code = -1; return; } --- 1352,1358 ---- { if (argc < 2 && !another(&argc, &argv, "arguments to SITE command")) { ! fprintf(ttyout, "usage: %s line-to-send\n", argv[0]); code = -1; return; } *************** *** 1399,1405 **** goto usage; if ((argc < 3 && !another(&argc, &argv, "file-name")) || argc > 3) { usage: ! printf("usage: %s mode file-name\n", argv[0]); code = -1; return; } --- 1400,1406 ---- goto usage; if ((argc < 3 && !another(&argc, &argv, "file-name")) || argc > 3) { usage: ! fprintf(ttyout, "usage: %s mode file-name\n", argv[0]); code = -1; return; } *************** *** 1495,1501 **** char *ap; if (argc > 2) { ! printf("usage: %s [password]\n", argv[0]); code = -1; return; } --- 1496,1502 ---- char *ap; if (argc > 2) { ! fprintf(ttyout, "usage: %s [password]\n", argv[0]); code = -1; return; } *************** *** 1537,1562 **** sig_t oldintr; if (argc < 2 && !another(&argc, &argv, "command")) { ! printf("usage: %s command\n", argv[0]); code = -1; return; } c = getcmd(argv[1]); if (c == (struct cmd *) -1) { ! puts("?Ambiguous command."); ! (void)fflush(stdout); code = -1; return; } if (c == 0) { ! puts("?Invalid command."); ! (void)fflush(stdout); code = -1; return; } if (!c->c_proxy) { ! puts("?Invalid proxy command."); ! (void)fflush(stdout); code = -1; return; } --- 1538,1563 ---- sig_t oldintr; if (argc < 2 && !another(&argc, &argv, "command")) { ! fprintf(ttyout, "usage: %s command\n", argv[0]); code = -1; return; } c = getcmd(argv[1]); if (c == (struct cmd *) -1) { ! fputs("?Ambiguous command.\n", ttyout); ! (void)fflush(ttyout); code = -1; return; } if (c == 0) { ! fputs("?Invalid command.\n", ttyout); ! (void)fflush(ttyout); code = -1; return; } if (!c->c_proxy) { ! fputs("?Invalid proxy command.\n", ttyout); ! (void)fflush(ttyout); code = -1; return; } *************** *** 1567,1574 **** oldintr = signal(SIGINT, proxabort); pswitch(1); if (c->c_conn && !connected) { ! puts("Not connected."); ! (void)fflush(stdout); pswitch(0); (void)signal(SIGINT, oldintr); code = -1; --- 1568,1575 ---- oldintr = signal(SIGINT, proxabort); pswitch(1); if (c->c_conn && !connected) { ! fputs("Not connected.\n", ttyout); ! (void)fflush(ttyout); pswitch(0); (void)signal(SIGINT, oldintr); code = -1; *************** *** 1613,1619 **** { if (argc == 1) { ntflag = 0; ! puts("Ntrans off."); code = ntflag; return; } --- 1614,1620 ---- { if (argc == 1) { ntflag = 0; ! fputs("Ntrans off.\n", ttyout); code = ntflag; return; } *************** *** 1667,1678 **** if (argc == 1) { mapflag = 0; ! puts("Nmap off."); code = mapflag; return; } if ((argc < 3 && !another(&argc, &argv, "mapout")) || argc > 3) { ! printf("usage: %s [mapin mapout]\n", argv[0]); code = -1; return; } --- 1668,1679 ---- if (argc == 1) { mapflag = 0; ! fputs("Nmap off.\n", ttyout); code = mapflag; return; } if ((argc < 3 && !another(&argc, &argv, "mapout")) || argc > 3) { ! fprintf(ttyout, "usage: %s [mapin mapout]\n", argv[0]); code = -1; return; } *************** *** 1802,1809 **** } } if (!*cp2) { ! puts( ! "nmap: unbalanced brackets."); return (name); } match = 1; --- 1803,1810 ---- } } if (!*cp2) { ! fputs( ! "nmap: unbalanced brackets.\n", ttyout); return (name); } match = 1; *************** *** 1816,1823 **** } } if (!*cp2) { ! puts( ! "nmap: unbalanced brackets."); return (name); } break; --- 1817,1824 ---- } } if (!*cp2) { ! fputs( ! "nmap: unbalanced brackets.\n", ttyout); return (name); } break; *************** *** 1903,1909 **** r = command("CDUP"); if (r == ERROR && code == 500) { if (verbose) ! puts("CDUP command not recognized, trying XCUP."); r = command("XCUP"); } if (r == COMPLETE) --- 1904,1910 ---- r = command("CDUP"); if (r == ERROR && code == 500) { if (verbose) ! fputs("CDUP command not recognized, trying XCUP.\n", ttyout); r = command("XCUP"); } if (r == COMPLETE) *************** *** 1918,1927 **** { if (argc != 2) ! puts("restart: offset not specified."); else { restart_point = atol(argv[1]); ! printf("Restarting at %qd. Execute get, put or append to" "initiate transfer\n", restart_point); } } --- 1919,1928 ---- { if (argc != 2) ! fputs("restart: offset not specified.\n", ttyout); else { restart_point = atol(argv[1]); ! fprintf(ttyout, "Restarting at %qd. Execute get, put or append to" "initiate transfer\n", restart_point); } } *************** *** 1945,1962 **** int c; if (macnum == 16) { ! puts("Limit of 16 macros have already been defined."); code = -1; return; } if ((argc < 2 && !another(&argc, &argv, "macro name")) || argc > 2) { ! printf("usage: %s macro_name\n", argv[0]); code = -1; return; } if (interactive) ! puts( ! "Enter macro line by line, terminating it with a null line."); (void)strncpy(macros[macnum].mac_name, argv[1], sizeof(macros[macnum].mac_name) - 1); macros[macnum].mac_name[sizeof(macros[macnum].mac_name) - 1] = '\0'; --- 1946,1963 ---- int c; if (macnum == 16) { ! fputs("Limit of 16 macros have already been defined.\n", ttyout); code = -1; return; } if ((argc < 2 && !another(&argc, &argv, "macro name")) || argc > 2) { ! fprintf(ttyout, "usage: %s macro_name\n", argv[0]); code = -1; return; } if (interactive) ! fputs( ! "Enter macro line by line, terminating it with a null line.\n", ttyout); (void)strncpy(macros[macnum].mac_name, argv[1], sizeof(macros[macnum].mac_name) - 1); macros[macnum].mac_name[sizeof(macros[macnum].mac_name) - 1] = '\0'; *************** *** 1967,1973 **** tmp = macros[macnum].mac_start; while (tmp != macbuf+4096) { if ((c = getchar()) == EOF) { ! puts("macdef: end of file encountered."); code = -1; return; } --- 1968,1974 ---- tmp = macros[macnum].mac_start; while (tmp != macbuf+4096) { if ((c = getchar()) == EOF) { ! fputs("macdef: end of file encountered.\n", ttyout); code = -1; return; } *************** *** 1990,1996 **** while ((c = getchar()) != '\n' && c != EOF) /* LOOP */; if (c == EOF || getchar() == '\n') { ! puts("Macro not defined - 4K buffer exceeded."); code = -1; return; } --- 1991,1997 ---- while ((c = getchar()) != '\n' && c != EOF) /* LOOP */; if (c == EOF || getchar() == '\n') { ! fputs("Macro not defined - 4K buffer exceeded.\n", ttyout); code = -1; return; } *************** *** 2008,2020 **** off_t size; if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) { ! printf("usage: %s filename\n", argv[0]); code = -1; return; } size = remotesize(argv[1], 1); if (size != -1) ! printf("%s\t%qd\n", argv[1], size); code = size; } --- 2009,2021 ---- off_t size; if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) { ! fprintf(ttyout, "usage: %s filename\n", argv[0]); code = -1; return; } size = remotesize(argv[1], 1); if (size != -1) ! fprintf(ttyout, "%s\t%qd\n", argv[1], size); code = size; } *************** *** 2029,2041 **** time_t mtime; if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) { ! printf("usage: %s filename\n", argv[0]); code = -1; return; } mtime = remotemodtime(argv[1], 1); if (mtime != -1) ! printf("%s\t%s", argv[1], asctime(localtime(&mtime))); code = mtime; } --- 2030,2042 ---- time_t mtime; if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) { ! fprintf(ttyout, "usage: %s filename\n", argv[0]); code = -1; return; } mtime = remotemodtime(argv[1], 1); if (mtime != -1) ! fprintf(ttyout, "%s\t%s", argv[1], asctime(localtime(&mtime))); code = mtime; } *************** *** 2061,2067 **** { if (getit(argc, argv, -1, "w")) ! printf("Local file \"%s\" is newer than remote file \"%s\".\n", argv[2], argv[1]); } --- 2062,2068 ---- { if (getit(argc, argv, -1, "w")) ! fprintf(ttyout, "Local file \"%s\" is newer than remote file \"%s\".\n", argv[2], argv[1]); } *************** *** 2077,2083 **** char *p, *pager; if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) { ! printf("usage: %s filename\n", argv[0]); code = -1; return; } --- 2078,2084 ---- char *p, *pager; if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) { ! fprintf(ttyout, "usage: %s filename\n", argv[0]); code = -1; return; }