diff options
author | Tijl Coosemans <tijl@FreeBSD.org> | 2012-01-28 18:49:04 +0000 |
---|---|---|
committer | Tijl Coosemans <tijl@FreeBSD.org> | 2012-01-28 18:49:04 +0000 |
commit | e57ac359cc7f7b52bd2a03ad79d99ec196b4ff72 (patch) | |
tree | a318cc7a0ac8c083ddaf2195997a4fb3b37c7a1a /usr.bin/hexdump | |
parent | 2cb08f8d7d5b2c472644f4ff93b9d7afb3a966ef (diff) | |
download | src-test2-e57ac359cc7f7b52bd2a03ad79d99ec196b4ff72.tar.gz src-test2-e57ac359cc7f7b52bd2a03ad79d99ec196b4ff72.zip |
Notes
Diffstat (limited to 'usr.bin/hexdump')
-rw-r--r-- | usr.bin/hexdump/parse.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index a87eddb15860..b10ce01948ba 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -451,21 +451,14 @@ escape(char *p1) char *p2; /* alphabetic escape sequences have to be done in place */ - for (p2 = p1; *p1; p1++, p2++) { - /* - * Let's take a peak at the next item and see whether or not - * we need to escape the value... - */ + for (p2 = p1;; p1++, p2++) { if (*p1 == '\\') { - p1++; - switch(*p1) { - /* A standalone `\' */ case '\0': *p2 = '\\'; *++p2 = '\0'; - break; + return; case 'a': /* *p2 = '\a'; */ *p2 = '\007'; @@ -492,12 +485,12 @@ escape(char *p1) *p2 = *p1; break; } - - } else + } else { *p2 = *p1; - + if (*p1 == '\0') + return; + } } - } void |