summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-12-16 23:49:13 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-12-16 23:49:13 +0000
commit9f739445cd3deddd0343c3a8d5a981ede26bef30 (patch)
tree6dc013e44d2281eb1e6f61c4bca1ae7546001f79 /networking
parenta597aaddfa76d589d3e1a37b1f1c3401c2decffd (diff)
downloadbusybox-w32-9f739445cd3deddd0343c3a8d5a981ede26bef30.tar.gz
busybox-w32-9f739445cd3deddd0343c3a8d5a981ede26bef30.tar.bz2
busybox-w32-9f739445cd3deddd0343c3a8d5a981ede26bef30.zip
inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid]
Diffstat (limited to 'networking')
-rw-r--r--networking/ftpgetput.c7
-rw-r--r--networking/libiproute/ipaddress.c2
-rw-r--r--networking/tftp.c2
-rw-r--r--networking/wget.c2
4 files changed, 6 insertions, 7 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 223d2435c..dff894468 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -132,7 +132,7 @@ int ftp_receive(ftp_host_info_t *server, FILE *control_stream,
132 do_continue = 0; 132 do_continue = 0;
133 } 133 }
134 134
135 if ((local_path[0] == '-') && (local_path[1] == '\0')) { 135 if (LONE_DASH(local_path)) {
136 fd_local = STDOUT_FILENO; 136 fd_local = STDOUT_FILENO;
137 do_continue = 0; 137 do_continue = 0;
138 } 138 }
@@ -212,9 +212,8 @@ int ftp_send(ftp_host_info_t *server, FILE *control_stream,
212 fd_data = xconnect_ftpdata(server, buf); 212 fd_data = xconnect_ftpdata(server, buf);
213 213
214 /* get the local file */ 214 /* get the local file */
215 if ((local_path[0] == '-') && (local_path[1] == '\0')) { 215 fd_local = STDIN_FILENO;
216 fd_local = STDIN_FILENO; 216 if (NOT_LONE_DASH(local_path)) {
217 } else {
218 fd_local = xopen(local_path, O_RDONLY); 217 fd_local = xopen(local_path, O_RDONLY);
219 fstat(fd_local, &sbuf); 218 fstat(fd_local, &sbuf);
220 219
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 2a267fef6..9fb08e6ba 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -681,7 +681,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
681 if (strcmp(*argv, "+") == 0) { 681 if (strcmp(*argv, "+") == 0) {
682 brd_len = -1; 682 brd_len = -1;
683 } 683 }
684 else if (strcmp(*argv, "-") == 0) { 684 else if (LONE_DASH(*argv)) {
685 brd_len = -2; 685 brd_len = -2;
686 } else { 686 } else {
687 get_addr(&addr, *argv, req.ifa.ifa_family); 687 get_addr(&addr, *argv, req.ifa.ifa_family);
diff --git a/networking/tftp.c b/networking/tftp.c
index 64d376fa7..a62c5d8cc 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -530,7 +530,7 @@ int tftp_main(int argc, char **argv)
530 if ((localfile == NULL && remotefile == NULL) || (argv[optind] == NULL)) 530 if ((localfile == NULL && remotefile == NULL) || (argv[optind] == NULL))
531 bb_show_usage(); 531 bb_show_usage();
532 532
533 if (localfile == NULL || strcmp(localfile, "-") == 0) { 533 if (localfile == NULL || LONE_DASH(localfile)) {
534 fd = (cmd == tftp_cmd_get) ? STDOUT_FILENO : STDIN_FILENO; 534 fd = (cmd == tftp_cmd_get) ? STDOUT_FILENO : STDIN_FILENO;
535 } else { 535 } else {
536 fd = open(localfile, flags, 0644); /* fail below */ 536 fd = open(localfile, flags, 0644); /* fail below */
diff --git a/networking/wget.c b/networking/wget.c
index 19bf8f887..fbdbf62f6 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -217,7 +217,7 @@ int wget_main(int argc, char **argv)
217 /* 217 /*
218 * Determine where to start transfer. 218 * Determine where to start transfer.
219 */ 219 */
220 if (fname_out[0] == '-' && !fname_out[1]) { 220 if (LONE_DASH(fname_out)) {
221 output_fd = 1; 221 output_fd = 1;
222 opt &= ~WGET_OPT_CONTINUE; 222 opt &= ~WGET_OPT_CONTINUE;
223 } 223 }