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 | 621c6b81e6f49223179aa1c0d0ceae17d3e8f6c1 (patch) | |
tree | 7cd5c1e1e610cfa033751347c521b1864de6cc24 | |
parent | ee51a735ac75774060f6f5ee84d81d1b37e85b6b (diff) | |
download | pyfilesystem-621c6b81e6f49223179aa1c0d0ceae17d3e8f6c1.tar.gz |
More accurate (and possibly more efficient) version of the _requires_normalization regex
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@842 67cdc799-7952-0410-af00-57a81ceafa0f
-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): |