From a8c92812e4c8b9cc908aa572cfa5a69ba834aaa6 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 7 Nov 2020 11:22:52 +0100 Subject: [PATCH] Escape file names with backticks in them. --- serializer.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.2