libbb: introduce and use strcpy_and_process_escape_sequences
function old new delta
strcpy_and_process_escape_sequences - 50 +50
bb_process_escape_sequence 148 138 -10
printf_main 789 776 -13
getty_main 1897 1831 -66
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/3 up/down: 50/-89) Total: -39 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/libbb/parse_config.c b/libbb/parse_config.c
index 3fff9f2..9dbfaf5 100644
--- a/libbb/parse_config.c
+++ b/libbb/parse_config.c
@@ -187,19 +187,7 @@
#if 0 /* unused so far */
if (flags & PARSE_ESCAPE) {
- const char *from;
- char *to;
-
- from = to = tokens[t];
- while (*from) {
- if (*from == '\\') {
- from++;
- *to++ = bb_process_escape_sequence(&from);
- } else {
- *to++ = *from++;
- }
- }
- *to = '\0';
+ strcpy_and_process_escape_sequences(tokens[t], tokens[t]);
}
#endif
/* Skip possible delimiters */