diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-28 23:37:46 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-28 23:37:46 +0000 |
commit | 601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b (patch) | |
tree | 79ad3707bb3374a2e429135ece7e604a26cde8c1 /networking | |
parent | df38188367a9fe10cc4efc00d3236be05178ff4e (diff) | |
download | busybox-w32-601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b.tar.gz busybox-w32-601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b.tar.bz2 busybox-w32-601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b.zip |
od: sometime ago I landed BIG od implementation
from coreutils. My fault. This commit contains
cleanups and size reductions.
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 16 | ||||
-rw-r--r-- | networking/wget.c | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 0de60ba06..f95e0c06e 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -671,7 +671,7 @@ static char *encodeString(const char *string) | |||
671 | * | 671 | * |
672 | * $Parameters: | 672 | * $Parameters: |
673 | * (char *) string . . . The first string to decode. | 673 | * (char *) string . . . The first string to decode. |
674 | * (int) flag . . . 1 if require decode '+' as ' ' for CGI | 674 | * (int) flag . . . 1 if need to decode '+' as ' ' for CGI |
675 | * | 675 | * |
676 | * $Return: (char *) . . . . A pointer to the decoded string (same as input). | 676 | * $Return: (char *) . . . . A pointer to the decoded string (same as input). |
677 | * | 677 | * |
@@ -685,14 +685,18 @@ static char *decodeString(char *orig, int flag_plus_to_space) | |||
685 | char *ptr = string; | 685 | char *ptr = string; |
686 | 686 | ||
687 | while (*ptr) { | 687 | while (*ptr) { |
688 | if (*ptr == '+' && flag_plus_to_space) { *string++ = ' '; ptr++; } | 688 | if (*ptr == '+' && flag_plus_to_space) { |
689 | else if (*ptr != '%') *string++ = *ptr++; | 689 | *string++ = ' '; |
690 | else { | 690 | ptr++; |
691 | } else if (*ptr != '%') { | ||
692 | *string++ = *ptr++; | ||
693 | } else { | ||
691 | unsigned int value1, value2; | 694 | unsigned int value1, value2; |
692 | 695 | ||
693 | ptr++; | 696 | ptr++; |
694 | if (sscanf(ptr, "%1X", &value1) != 1 || | 697 | if (sscanf(ptr, "%1X", &value1) != 1 |
695 | sscanf(ptr+1, "%1X", &value2) != 1) { | 698 | || sscanf(ptr+1, "%1X", &value2) != 1 |
699 | ) { | ||
696 | if (!flag_plus_to_space) | 700 | if (!flag_plus_to_space) |
697 | return NULL; | 701 | return NULL; |
698 | *string++ = '%'; | 702 | *string++ = '%'; |
diff --git a/networking/wget.c b/networking/wget.c index 49ebda73c..028e18c73 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -139,7 +139,7 @@ int wget_main(int argc, char **argv) | |||
139 | { "passive-ftp", no_argument, NULL, 0xff }, | 139 | { "passive-ftp", no_argument, NULL, 0xff }, |
140 | { "header", required_argument, NULL, 0xfe }, | 140 | { "header", required_argument, NULL, 0xfe }, |
141 | { 0, 0, 0, 0 } | 141 | { 0, 0, 0, 0 } |
142 | }; | 142 | }; |
143 | applet_long_options = wget_long_options; | 143 | applet_long_options = wget_long_options; |
144 | #endif | 144 | #endif |
145 | opt_complementary = "-1" USE_FEATURE_WGET_LONG_OPTIONS(":\xfe::"); | 145 | opt_complementary = "-1" USE_FEATURE_WGET_LONG_OPTIONS(":\xfe::"); |