modified bts2str to also escape double quotes
authorceriel <none@none>
Wed, 5 Oct 1988 16:19:42 +0000 (16:19 +0000)
committerceriel <none@none>
Wed, 5 Oct 1988 16:19:42 +0000 (16:19 +0000)
modules/src/string/bts2str.c
modules/src/string/string.3

index 0403f21..a529de2 100644 (file)
@@ -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++ = '\\';
index 0e02840..e935315 100644 (file)
@@ -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