Skip to content

Commit

Permalink
git-gui: Replace \ with \\ when showing paths.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn O. Pearce committed Feb 8, 2007
1 parent 9bccb78 commit 42b922f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,7 @@ proc mapdesc {state path} {
}

proc escape_path {path} {
regsub -all {\\} $path "\\\\" path
regsub -all "\n" $path "\\n" path
return $path
}
Expand Down

0 comments on commit 42b922f

Please sign in to comment.