diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-25 12:14:21 +0200 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-25 12:14:21 +0200 |
| commit | a2d27a19197cc5ed787dc2439df0cae58053ea2c (patch) | |
| tree | 75789b79f011b519793c1c4976421c310bdfccdc | |
| parent | b507cc3aceda26eff851230223a62c6fb471573c (diff) | |
| download | busybox-w32-a2d27a19197cc5ed787dc2439df0cae58053ea2c.tar.gz busybox-w32-a2d27a19197cc5ed787dc2439df0cae58053ea2c.tar.bz2 busybox-w32-a2d27a19197cc5ed787dc2439df0cae58053ea2c.zip | |
libbb/process_escape_sequence.c: fix recently broken handling of \\
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
| -rw-r--r-- | libbb/process_escape_sequence.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c index 7b1d97f9c..346ecfa1e 100644 --- a/libbb/process_escape_sequence.c +++ b/libbb/process_escape_sequence.c | |||
| @@ -75,8 +75,8 @@ char FAST_FUNC bb_process_escape_sequence(const char **ptr) | |||
| 75 | * Manpages tend to support coreutils way. | 75 | * Manpages tend to support coreutils way. |
| 76 | * Update: coreutils added support for \e on 28 Oct 2009. */ | 76 | * Update: coreutils added support for \e on 28 Oct 2009. */ |
| 77 | static const char charmap[] ALIGN1 = { | 77 | static const char charmap[] ALIGN1 = { |
| 78 | 'a', 'b', 'e', 'f', 'n', 'r', 't', 'v', '\\', | 78 | 'a', 'b', 'e', 'f', 'n', 'r', 't', 'v', '\\', '\0', |
| 79 | '\a', '\b', 27, '\f', '\n', '\r', '\t', '\v', '\\', | 79 | '\a', '\b', 27, '\f', '\n', '\r', '\t', '\v', '\\', '\\', |
| 80 | }; | 80 | }; |
| 81 | const char *p = charmap; | 81 | const char *p = charmap; |
| 82 | do { | 82 | do { |
| @@ -84,8 +84,8 @@ char FAST_FUNC bb_process_escape_sequence(const char **ptr) | |||
| 84 | q++; | 84 | q++; |
| 85 | break; | 85 | break; |
| 86 | } | 86 | } |
| 87 | } while (*++p != '\\'); | 87 | } while (*++p != '\0'); |
| 88 | /* p points to found escape char or '\', | 88 | /* p points to found escape char or NUL, |
| 89 | * advance it and find what it translates to. | 89 | * advance it and find what it translates to. |
| 90 | * Note that \NUL and unrecognized sequence \z return '\' | 90 | * Note that \NUL and unrecognized sequence \z return '\' |
| 91 | * and leave ptr pointing to NUL or z. */ | 91 | * and leave ptr pointing to NUL or z. */ |
