mirror of https://github.com/mirror/busybox.git
od: sometime ago I landed BIG od implementation
from coreutils. My fault. This commit contains cleanups and size reductions.1_4_stable
parent
df38188367
commit
601ae1378b
File diff suppressed because it is too large
Load Diff
|
@ -671,7 +671,7 @@ static char *encodeString(const char *string)
|
||||||
*
|
*
|
||||||
* $Parameters:
|
* $Parameters:
|
||||||
* (char *) string . . . The first string to decode.
|
* (char *) string . . . The first string to decode.
|
||||||
* (int) flag . . . 1 if require decode '+' as ' ' for CGI
|
* (int) flag . . . 1 if need to decode '+' as ' ' for CGI
|
||||||
*
|
*
|
||||||
* $Return: (char *) . . . . A pointer to the decoded string (same as input).
|
* $Return: (char *) . . . . A pointer to the decoded string (same as input).
|
||||||
*
|
*
|
||||||
|
@ -685,14 +685,18 @@ static char *decodeString(char *orig, int flag_plus_to_space)
|
||||||
char *ptr = string;
|
char *ptr = string;
|
||||||
|
|
||||||
while (*ptr) {
|
while (*ptr) {
|
||||||
if (*ptr == '+' && flag_plus_to_space) { *string++ = ' '; ptr++; }
|
if (*ptr == '+' && flag_plus_to_space) {
|
||||||
else if (*ptr != '%') *string++ = *ptr++;
|
*string++ = ' ';
|
||||||
else {
|
ptr++;
|
||||||
|
} else if (*ptr != '%') {
|
||||||
|
*string++ = *ptr++;
|
||||||
|
} else {
|
||||||
unsigned int value1, value2;
|
unsigned int value1, value2;
|
||||||
|
|
||||||
ptr++;
|
ptr++;
|
||||||
if (sscanf(ptr, "%1X", &value1) != 1 ||
|
if (sscanf(ptr, "%1X", &value1) != 1
|
||||||
sscanf(ptr+1, "%1X", &value2) != 1) {
|
|| sscanf(ptr+1, "%1X", &value2) != 1
|
||||||
|
) {
|
||||||
if (!flag_plus_to_space)
|
if (!flag_plus_to_space)
|
||||||
return NULL;
|
return NULL;
|
||||||
*string++ = '%';
|
*string++ = '%';
|
||||||
|
|
|
@ -139,7 +139,7 @@ int wget_main(int argc, char **argv)
|
||||||
{ "passive-ftp", no_argument, NULL, 0xff },
|
{ "passive-ftp", no_argument, NULL, 0xff },
|
||||||
{ "header", required_argument, NULL, 0xfe },
|
{ "header", required_argument, NULL, 0xfe },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
applet_long_options = wget_long_options;
|
applet_long_options = wget_long_options;
|
||||||
#endif
|
#endif
|
||||||
opt_complementary = "-1" USE_FEATURE_WGET_LONG_OPTIONS(":\xfe::");
|
opt_complementary = "-1" USE_FEATURE_WGET_LONG_OPTIONS(":\xfe::");
|
||||||
|
|
Loading…
Reference in New Issue