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>
This commit is contained in:
Shawn O. Pearce 2007-02-08 17:13:51 -05:00
parent 9bccb782c3
commit 42b922fcf6

View File

@ -1381,6 +1381,7 @@ proc mapdesc {state path} {
}
proc escape_path {path} {
regsub -all {\\} $path "\\\\" path
regsub -all "\n" $path "\\n" path
return $path
}