X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=serializer.cpp;h=7f3e88842da24ab9bf5d84360a8284bc1cf2061f;hb=eb4a3c2c5efd9ce0e204e54c78f64d3d96b49091;hp=d2f126c0aaa89fe3ee42833fa1b35894553ac75f;hpb=0dbaef532de6e14de9fed7cb29186e43246a6dd3;p=plocate diff --git a/serializer.cpp b/serializer.cpp index d2f126c..7f3e888 100644 --- a/serializer.cpp +++ b/serializer.cpp @@ -32,7 +32,7 @@ void print_possibly_escaped(const string &str) if (print_nul) { printf("%s%c", str.c_str(), 0); return; - } else if (!stdout_is_tty) { + } else if (literal_printing || !stdout_is_tty) { printf("%s\n", str.c_str()); return; } @@ -56,6 +56,9 @@ void print_possibly_escaped(const string &str) break; // EOF. } else if (pwc < 32 || pwc == '\'' || pwc == '"' || pwc == '\\') { all_safe = false; + } else if (pwc == '`') { + // A rather odd case; ls quotes this but does not escape it. + all_safe = false; } else { ptr += ret; len -= ret;