From b909bb629bdee3c134351d4d623e296d73cf8864 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 5 Oct 1988 16:19:42 +0000 Subject: [PATCH] modified bts2str to also escape double quotes --- modules/src/string/bts2str.c | 2 +- modules/src/string/string.3 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- 2.34.1