Commit be810e52 authored by owsla's avatar owsla

Technically, lpt[3-9] should also be quoted (see sys/fs/vfat/namei.c in

Linux kernel)


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@821 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent e83934f3
......@@ -88,9 +88,9 @@ def quote(path):
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-2.
# extension. Special names are: aux, prn, con, nul, com0-9, and lpt1-9.
if not re.search(r"^aux(\..*)*$|^prn(\..*)*$|^con(\..*)*$|^nul(\..*)*$|" \
r"^com[0-9](\..*)*$|^lpt[12]{1}(\..*)*$", QuotedPath, \
r"^com[0-9](\..*)*$|^lpt[1-9]{1}(\..*)*$", QuotedPath, \
re.I):
return QuotedPath
return "%s%03d" % (quoting_char, ord(QuotedPath[0])) + QuotedPath[1:]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment