aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-04-11 20:03:01 +0000
committerMatt Kraai <kraai@debian.org>2001-04-11 20:03:01 +0000
commit65317ea27fd048686d4d75a116db3e869b7c0093 (patch)
tree7765673795aed0d83476837789364162067b4a59
parented897e541502045245699f028dfe986abaecf1ba (diff)
downloadbusybox-65317ea27fd048686d4d75a116db3e869b7c0093.tar.gz
Fix behavior when extracting to stdout. Report and patch by
Evin Robertson <nitfol@my-deja.com>.
-rw-r--r--networking/wget.c10
-rw-r--r--wget.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 79f7e61cf..c416a5862 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -141,7 +141,7 @@ int wget_main(int argc, char **argv)
* this gets interpreted as the auto-gen output filename
* case below - tausq@debian.org
*/
- fname_out = (strcmp(optarg, "-") == 0 ? (char *)1 : optarg);
+ fname_out = optarg;
break;
default:
show_usage();
@@ -188,10 +188,10 @@ int wget_main(int argc, char **argv)
/*
* Open the output file stream.
*/
- if (fname_out != (char *)1) {
- output = xfopen( fname_out, (do_continue ? "a" : "w") );
- } else {
+ if (strcmp(fname_out, "-") == 0) {
output = stdout;
+ } else {
+ output = xfopen(fname_out, (do_continue ? "a" : "w"));
}
/*
@@ -732,7 +732,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.32 2001/04/10 18:17:05 andersen Exp $
+ * $Id: wget.c,v 1.33 2001/04/11 20:03:01 kraai Exp $
*/
diff --git a/wget.c b/wget.c
index 79f7e61cf..c416a5862 100644
--- a/wget.c
+++ b/wget.c
@@ -141,7 +141,7 @@ int wget_main(int argc, char **argv)
* this gets interpreted as the auto-gen output filename
* case below - tausq@debian.org
*/
- fname_out = (strcmp(optarg, "-") == 0 ? (char *)1 : optarg);
+ fname_out = optarg;
break;
default:
show_usage();
@@ -188,10 +188,10 @@ int wget_main(int argc, char **argv)
/*
* Open the output file stream.
*/
- if (fname_out != (char *)1) {
- output = xfopen( fname_out, (do_continue ? "a" : "w") );
- } else {
+ if (strcmp(fname_out, "-") == 0) {
output = stdout;
+ } else {
+ output = xfopen(fname_out, (do_continue ? "a" : "w"));
}
/*
@@ -732,7 +732,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.32 2001/04/10 18:17:05 andersen Exp $
+ * $Id: wget.c,v 1.33 2001/04/11 20:03:01 kraai Exp $
*/