diff options
author | gcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f> | 2012-12-22 23:43:06 +0000 |
---|---|---|
committer | gcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f> | 2012-12-22 23:43:06 +0000 |
commit | bdf95abfb5a2e5102db8bb89d765ef0484b48296 (patch) | |
tree | 7cd5c1e1e610cfa033751347c521b1864de6cc24 | |
parent | 4a5b5409eefc21e1ebfae86371774e1ebfb112fc (diff) | |
download | pyfilesystem-git-bdf95abfb5a2e5102db8bb89d765ef0484b48296.tar.gz |
More accurate (and possibly more efficient) version of the _requires_normalization regex
-rw-r--r-- | fs/path.py | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -14,9 +14,7 @@ import re import os -#_requires_normalization = re.compile(r'/\.\.|\./|\.|//').search -# New improved re that avoids normalizing paths that don't need it - WM -_requires_normalization = re.compile(r'/\.\.|\./|^\.$|\.$|//').search +_requires_normalization = re.compile(r'(^|/)\.\.?($|/)|//').search def normpath(path): |