Shouldn't mangle_path always mangle '\\'?

From: Daniel Colascione (SEATTLE)
Date: Fri Apr 24 2015 - 19:16:59 EST


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?

diff --git a/fs/seq_file.c b/fs/seq_file.c
index 555f821..02dcd5c 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -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;

Attachment: signature.asc
Description: OpenPGP digital signature