]> git.sesse.net Git - plocate/commitdiff
Escape file names with backticks in them.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 7 Nov 2020 10:22:52 +0000 (11:22 +0100)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 7 Nov 2020 10:22:52 +0000 (11:22 +0100)
serializer.cpp

index d2f126c0aaa89fe3ee42833fa1b35894553ac75f..f27a865a06e997bec1de0a408624b322c05a6dfb 100644 (file)
@@ -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;