summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f>2012-12-22 23:43:06 +0000
committergcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f>2012-12-22 23:43:06 +0000
commit621c6b81e6f49223179aa1c0d0ceae17d3e8f6c1 (patch)
tree7cd5c1e1e610cfa033751347c521b1864de6cc24
parentee51a735ac75774060f6f5ee84d81d1b37e85b6b (diff)
downloadpyfilesystem-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.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/path.py b/fs/path.py
index 4378229..806725a 100644
--- a/fs/path.py
+++ b/fs/path.py
@@ -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):