fshash.in: Remove ambiguity for filenames containing ` -> '.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 7 Oct 2012 14:52:10 +0000 (15:52 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 7 Oct 2012 14:52:10 +0000 (15:52 +0100)
The problem is that we can't tell which occurrence is the separator for
a symbolic link.  Fix this by adding an otherwise pointless backslash.

fshash.in

index 1dbd8be..b6aa4cf 100644 (file)
--- a/fshash.in
+++ b/fshash.in
@@ -348,7 +348,7 @@ class GenericFormatter (object):
     tm = T.gmtime(t)
     return T.strftime('%Y-%m-%dT%H:%M:%SZ', tm)
   def _enc_name(me, n):
-    return n.encode('string_escape')
+    return ' \\-> '.join(n.encode('string_escape').split(' -> '))
   def name(me):
     return me._enc_name(me.fi.name)
   def info(me):