Created
May 30, 2014 10:22
-
-
Save k-takata/846bad3960daefc4847b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/plugin/editorconfig-core-py/editorconfig/ini.py | |
+++ b/plugin/editorconfig-core-py/editorconfig/ini.py | |
@@ -17,10 +17,10 @@ import re | |
from codecs import open | |
import posixpath | |
from os import sep | |
-from os.path import normcase, dirname | |
+from os.path import dirname | |
from editorconfig.exceptions import ParsingError | |
-from editorconfig.fnmatch import fnmatch | |
+from editorconfig.fnmatch import fnmatchcase | |
from editorconfig.odict import OrderedDict | |
from editorconfig.compat import u | |
@@ -59,7 +59,7 @@ class EditorConfigParser(object): | |
def matches_filename(self, config_filename, glob): | |
"""Return True if section glob matches filename""" | |
- config_dirname = normcase(dirname(config_filename)).replace(sep, '/') | |
+ config_dirname = dirname(config_filename).replace(sep, '/') | |
glob = glob.replace("\\#", "#") | |
glob = glob.replace("\\;", ";") | |
if '/' in glob: | |
@@ -68,7 +68,7 @@ class EditorConfigParser(object): | |
glob = posixpath.join(config_dirname, glob) | |
else: | |
glob = posixpath.join('**/', glob) | |
- return fnmatch(self.filename, glob) | |
+ return fnmatchcase(self.filename.replace(sep, '/'), glob) | |
def read(self, filename): | |
"""Read and parse single EditorConfig file""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The removal of normcase makes path shortening not available:
X:\a\b\..\c
would not be shortened. Anyway, see my new comment in editorconfig/editorconfig#144.