From: ceriel Date: Wed, 5 Oct 1988 16:19:42 +0000 (+0000) Subject: modified bts2str to also escape double quotes X-Git-Tag: release-5-5~2805 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b909bb629bdee3c134351d4d623e296d73cf8864;p=ack.git modified bts2str to also escape double quotes --- diff --git a/modules/src/string/bts2str.c b/modules/src/string/bts2str.c index 0403f21ae..a529de264 100644 --- a/modules/src/string/bts2str.c +++ b/modules/src/string/bts2str.c @@ -19,7 +19,7 @@ bts2str(b, n, s) while (n-- > 0) { if (is_print(*f)) { - if (*f == '\\') *t++ = *f; + if (*f == '\\' || *f == '"') *t++ = '\\'; *t++ = *f++; } else { *t++ = '\\'; diff --git a/modules/src/string/string.3 b/modules/src/string/string.3 index 0e0284020..e93531556 100644 --- a/modules/src/string/string.3 +++ b/modules/src/string/string.3 @@ -156,6 +156,7 @@ into a null-terminated string, starting at .IR s . Printable characters are copied and non-printable characters are transformed into sequences of printable characters, representing those characters. +Also, back-slashes and double quotes are escaped with a back-slash. The transformation agrees with the representation of non-printable characters in C strings. .br