script: fix escaping in the dot command

This commit is contained in:
Přemysl Eric Janouch 2014-10-03 22:21:10 +02:00
parent ca05277ce7
commit aaf6385811

View File

@ -1805,9 +1805,9 @@ string_to_str (const struct item_string *string, struct buffer *buf)
for (size_t i = 0; i < string->len; i++) for (size_t i = 0; i < string->len; i++)
{ {
char c = string->value[i]; char c = string->value[i];
if (c == '\n') buffer_append (buf, "\\\n", 2); if (c == '\n') buffer_append (buf, "\\n", 2);
else if (c == '\r') buffer_append (buf, "\\\r", 2); else if (c == '\r') buffer_append (buf, "\\r", 2);
else if (c == '\t') buffer_append (buf, "\\\t", 2); else if (c == '\t') buffer_append (buf, "\\t", 2);
else if (!isprint (c)) else if (!isprint (c))
{ {
char tmp[8]; char tmp[8];