summaryrefslogtreecommitdiff
path: root/libbb/process_escape_sequence.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-09 13:04:50 +0000
committerDenis Vlasenko2007-04-09 13:04:50 +0000
commit7e754f12d304704d44e10fd4d2fdb8710526656e (patch)
tree9aa16703d48b9a7a38ccaec3759a19e95e976383 /libbb/process_escape_sequence.c
parent2dfdd44d9d6c3984501683bbac2e78b18eeae1e7 (diff)
downloadbusybox-7e754f12d304704d44e10fd4d2fdb8710526656e.zip
busybox-7e754f12d304704d44e10fd4d2fdb8710526656e.tar.gz
Implement first instance of NOFORK applet - echo
find: use NOFORK/NOEXEC; small -exec buglet also eliminated vfork_daemon_rexec: honor PREFER_APPLETS echo: small size improvements find -exec echo {} \; with PREFER_APPLETS=y runs 4 times faster
Diffstat (limited to 'libbb/process_escape_sequence.c')
-rw-r--r--libbb/process_escape_sequence.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c
index 138e751..3178ad3 100644
--- a/libbb/process_escape_sequence.c
+++ b/libbb/process_escape_sequence.c
@@ -8,9 +8,6 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <limits.h>
-#include <ctype.h>
#include "libbb.h"
#define WANT_HEX_ESCAPES 1
@@ -46,10 +43,10 @@ char bb_process_escape_sequence(const char **ptr)
#endif
do {
- d = (unsigned int)(*q - '0');
+ d = (unsigned char)(*q) - '0';
#ifdef WANT_HEX_ESCAPES
if (d >= 10) {
- d = ((unsigned int)(_tolower(*q) - 'a')) + 10;
+ d = (unsigned char)(_tolower(*q)) - 'a' + 10;
}
#endif
@@ -80,7 +77,7 @@ char bb_process_escape_sequence(const char **ptr)
break;
}
} while (*++p);
- n = *(p+(sizeof(charmap)/2));
+ n = *(p + (sizeof(charmap)/2));
}
*ptr = q;