All of lore.kernel.org
 help / color / mirror / Atom feed
* Shouldn't mangle_path always mangle '\\'?
@ 2015-04-24 23:16 Daniel Colascione (SEATTLE)
  0 siblings, 0 replies; only message in thread
From: Daniel Colascione (SEATTLE) @ 2015-04-24 23:16 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-24 23:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-24 23:16 Shouldn't mangle_path always mangle '\\'? Daniel Colascione (SEATTLE)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.