X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=serializer.cpp;h=f27a865a06e997bec1de0a408624b322c05a6dfb;hb=498466c6434e479cd973fe7655b4feb51dd2c378;hp=7d4ce119fceff9683584dbc8898682e1e9c9662e;hpb=355ab0d214ee0f08fb44ebeafd70d5e93db84c10;p=plocate diff --git a/serializer.cpp b/serializer.cpp index 7d4ce11..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; @@ -84,6 +87,7 @@ void print_possibly_escaped(const string &str) printf("?"); ++ptr; --len; + continue; } else if (ret == 0) { break; // EOF. }