@matheusbsbs / matheus-bagliano / commits / 42b922fcf6
Fork 0

git-gui: Replace \ with \\ when showing paths.

We already replace \n with \\n so that Tk widgets don't start a new display line with part of a file path which is just unlucky enough to contain an LF. But then its confusing to read a path whose name actually contains \n as literal characters. Escaping \ to \\ would make that case display as \\n, clarifying the output. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Feb 8, 2007 at 17:13 UTC 42b922fcf6f3bd16c4579f2b9e1e52c79096eba2
1 file changed +1
git-gui.sh
+1
@@ -1381,6 +1381,7 @@ proc mapdesc {state path} {
1381 }
1382
1383 proc escape_path {path} {
1384 + regsub -all {\\} $path "\\\\" path
1385 regsub -all "\n" $path "\\n" path
1386 return $path
1387 }