diff options
author | dgaudet <dgaudet@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2007-01-29 17:38:58 +0000 |
---|---|---|
committer | dgaudet <dgaudet@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2007-01-29 17:38:58 +0000 |
commit | 753a094e5ec3b1e1df86090e891edb81769c61d8 (patch) | |
tree | 4af28492ec8aca9540179b6342902961bb657d0c /rdiff-backup/rdiff_backup/selection.py | |
parent | d79facba72670e9233b40867a9ad1795ddefd80c (diff) | |
download | rdiff-backup-753a094e5ec3b1e1df86090e891edb81769c61d8.tar.gz |
Glob escaping support via backslash. (Andrew Price)
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@786 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/selection.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/selection.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rdiff-backup/rdiff_backup/selection.py b/rdiff-backup/rdiff_backup/selection.py index 96b53aa..47bc1ef 100644 --- a/rdiff-backup/rdiff_backup/selection.py +++ b/rdiff-backup/rdiff_backup/selection.py @@ -77,7 +77,7 @@ class Select: """ # This re should not match normal filenames, but usually just globs - glob_re = re.compile("(.*[*?[]|ignorecase\\:)", re.I | re.S) + glob_re = re.compile("(.*[*?[\\\\]|ignorecase\\:)", re.I | re.S) def __init__(self, rootrp): """Select initializer. rpath is the root directory""" @@ -640,7 +640,10 @@ probably isn't what you meant.""" % while i < n: c, s = pat[i], pat[i:i+2] i = i+1 - if s == '**': + if c == '\\': + res = res + re.escape(s[-1]) + i = i + 1 + elif s == '**': res = res + '.*' i = i + 1 elif c == '*': res = res + '[^/]*' |