summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/FilenameMapping.py
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-11-13 01:14:59 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-11-13 01:14:59 +0000
commit7bf31a4c2913be2d627ca08b38d407678bd85ae7 (patch)
tree9315f45d3f8f6000ac0b6603e75973cb4e0176cb /rdiff-backup/rdiff_backup/FilenameMapping.py
parent6e5c3e176685cbdbce504d2ae09893504b0fdbf4 (diff)
downloadrdiff-backup-7bf31a4c2913be2d627ca08b38d407678bd85ae7.tar.gz
Final fixes to trailing spaces support
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@963 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/FilenameMapping.py')
-rw-r--r--rdiff-backup/rdiff_backup/FilenameMapping.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/rdiff-backup/rdiff_backup/FilenameMapping.py b/rdiff-backup/rdiff_backup/FilenameMapping.py
index 439836e..8bb3951 100644
--- a/rdiff-backup/rdiff_backup/FilenameMapping.py
+++ b/rdiff-backup/rdiff_backup/FilenameMapping.py
@@ -89,17 +89,15 @@ def quote(path):
and not Globals.must_escape_trailing_spaces:
return QuotedPath
- if Globals.must_escape_dos_devices:
- assert Globals.must_escape_trailing_spaces
-
# Escape a trailing space or period (invalid in names on FAT32 under DOS,
# Windows and modern Linux)
- if len(QuotedPath) and (QuotedPath[-1] == ' ' or QuotedPath[-1] == '.'):
- QuotedPath = QuotedPath[:-1] + \
+ if Globals.must_escape_trailing_spaces:
+ if len(QuotedPath) and (QuotedPath[-1] == ' ' or QuotedPath[-1] == '.'):
+ QuotedPath = QuotedPath[:-1] + \
"%s%03d" % (quoting_char, ord(QuotedPath[-1]))
- if not Globals.must_escape_dos_devices:
- return QuotedPath
+ if not Globals.must_escape_dos_devices:
+ return QuotedPath
# Escape first char of any special DOS device files even if filename has an
# extension. Special names are: aux, prn, con, nul, com0-9, and lpt1-9.