diff options
author | Alexander Hall <halex@cvs.openbsd.org> | 2010-06-29 23:12:34 +0000 |
---|---|---|
committer | Alexander Hall <halex@cvs.openbsd.org> | 2010-06-29 23:12:34 +0000 |
commit | 59b73cb93a92df2724907f10a108787ecda54fff (patch) | |
tree | 5ba00dfd068988c6a9fe293cda1aa9152c403bd6 /usr.bin/ftp/fetch.c | |
parent | d89d127e66ee4af18d3882acb5640e109ef4ce1b (diff) |
fix output handling:
- if a remote file by the name '-' is retrieved, that does not imply
it should go to standard output...
- make -o '' reset any previous -o action
- properly handle multiple -o 's
ok phessler@
Diffstat (limited to 'usr.bin/ftp/fetch.c')
-rw-r--r-- | usr.bin/ftp/fetch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 391706924bc..bd6d71a700a 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.99 2010/06/03 07:50:02 halex Exp $ */ +/* $OpenBSD: fetch.c,v 1.100 2010/06/29 23:12:33 halex Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -259,7 +259,7 @@ noslash: } #ifndef SMALL - if (resume && (strcmp(savefile, "-") == 0)) { + if (resume && pipeout) { warnx("can't append to stdout"); goto cleanup_url_get; } @@ -337,7 +337,7 @@ noslash: filesize = st.st_size; /* Open the output file. */ - if (strcmp(savefile, "-") != 0) { + if (!pipeout) { #ifndef SMALL if (resume) out = open(savefile, O_CREAT | O_WRONLY | @@ -758,7 +758,7 @@ again: } /* Open the output file. */ - if (strcmp(savefile, "-") != 0) { + if (!pipeout) { #ifndef SMALL if (resume) out = open(savefile, O_CREAT | O_WRONLY | O_APPEND, |