summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/FilenameMapping.py
diff options
context:
space:
mode:
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.