summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2023-12-12 22:00:44 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2023-12-12 22:00:44 +0000
commitcb3e6317a0f8cc8844a345589f3ecccb1d8d54e6 (patch)
tree89041860e0bded4aabded885eeae2ab3d3fb9b12 /usr.bin/ftp
parent22f8c625f23c47b0eb2140917090a8a9cc295cc0 (diff)
Make -o less special, drop -o '' support, always use last value
ftp(1) says -o is about a single file/URL, but option handling takes the empty string as "reset previous -o value", which makes little sense, is undocumented and counter-intuitively works as if no -o was specified. OK millert
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/main.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 53e588efef2..2aecd5ad3ee 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.143 2023/11/30 14:52:00 kn Exp $ */
+/* $OpenBSD: main.c,v 1.144 2023/12/12 22:00:43 kn Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -502,14 +502,8 @@ main(volatile int argc, char *argv[])
case 'o':
outfile = optarg;
- if (*outfile == '\0') {
- pipeout = 0;
- outfile = NULL;
- ttyout = stdout;
- } else {
- pipeout = strcmp(outfile, "-") == 0;
- ttyout = pipeout ? stderr : stdout;
- }
+ pipeout = strcmp(outfile, "-") == 0;
+ ttyout = pipeout ? stderr : stdout;
break;
case 'p':