From: Steinar H. Gunderson Date: Sat, 7 Nov 2020 10:22:52 +0000 (+0100) Subject: Escape file names with backticks in them. X-Git-Tag: 1.1.0~26 X-Git-Url: https://git.sesse.net/?p=plocate;a=commitdiff_plain;h=a8c92812e4c8b9cc908aa572cfa5a69ba834aaa6 Escape file names with backticks in them. --- diff --git a/serializer.cpp b/serializer.cpp index d2f126c..f27a865 100644 --- a/serializer.cpp +++ b/serializer.cpp @@ -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;