1
1
mirror of http://git.sesse.net/plocate synced 2025-10-05 23:42:49 +02:00

Fix an issue where non-ASCII characters would be wrongly escaped.

This only happens on platforms with signed char. Reported by
COLIN Stéphane.
This commit is contained in:
Steinar H. Gunderson
2021-10-30 00:42:16 +02:00
parent eb4a3c2c5e
commit 715897115c

View File

@@ -91,7 +91,7 @@ void print_possibly_escaped(const string &str)
} else if (ret == 0) {
break; // EOF.
}
if (*ptr < 32 || *ptr == '\'' || *ptr == '"' || *ptr == '\\') {
if ((unsigned char)*ptr < 32 || *ptr == '\'' || *ptr == '"' || *ptr == '\\') {
if (!in_escaped_mode) {
printf("'$'");
in_escaped_mode = true;