Skip to contentSkip to conversation

Shouldn't mangle_path always mangle '\\'?

PATCH Daniel Colascione (SEATTLE) 1 participant 1 message Apr 24, 2015 VFS

lore
Share & tools
lore
#0 lore raw

mangle_path accepts a string listing the characters it's supposed to escape. Some, but not all, callers put backslash in this set. Shouldn't we be escaping '\' regardless, since it's the character used to signal all other escapes?

fs/seq_file.c +0 -0
index 555f821..02dcd5c 100644
@@ -443,7 +443,7 @@ char *mangle_path(char *s, const char *p, const char

*esc)
char c = *p++;
if (!c) {
return s;
- } else if (!strchr(esc, c)) {
+ } else if (s != '\\' && !strchr(esc, c)) {
*s++ = c;
} else if (s + 4 > p) {
break;