diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-16 16:49:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-16 16:49:38 +0000 |
commit | 8cb6f21e1aadad2c1e114a7504425029300edb03 (patch) | |
tree | d5b49d600f6c38757e0e13ebe981ec41f394f959 /dir.c | |
parent | 17d31216ea903fa6cd464d16b5f1512479da62c1 (diff) | |
download | ruby-8cb6f21e1aadad2c1e114a7504425029300edb03.tar.gz |
dir.c: reduce matching
* dir.c (glob_helper): reduce matching at non-mgaical path on
Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1404,7 +1404,19 @@ glob_helper( if (magical || recursive) { struct dirent *dp; DIR *dirp; +# if DOSISH + char *plainname = 0; +# endif IF_HAVE_HFS(int hfs_p); +# if DOSISH + if (cur + 1 == end && (*cur)->type <= ALPHA) { + plainname = join_path(path, pathlen, dirsep, (*cur)->str, strlen((*cur)->str)); + if (!plainname) return -1; + dirp = do_opendir(plainname, flags, enc); + GLOB_FREE(plainname); + } + else +# endif dirp = do_opendir(*path ? path : ".", flags, enc); if (dirp == NULL) { # if FNM_SYSCASE || HAVE_HFS @@ -1489,6 +1501,12 @@ glob_helper( } switch (p->type) { case ALPHA: +# ifdef DOSISH + if (plainname) { + *new_end++ = p->next; + break; + } +# endif case MAGICAL: if (fnmatch(p->str, enc, name, flags) == 0) *new_end++ = p->next; |