support GLOB_PERIOD flag (GNU extension) to glob function
authorRich Felker <dalias@aerifal.cx>
Sun, 22 Jan 2012 20:49:42 +0000 (15:49 -0500)
committerRich Felker <dalias@aerifal.cx>
Sun, 22 Jan 2012 20:49:42 +0000 (15:49 -0500)
patch by sh4rm4

src/regex/glob.c

index 550f655..bbe78f7 100644 (file)
@@ -58,7 +58,8 @@ static int match_in_dir(const char *d, const char *p, int flags, int (*errfunc)(
        char *p2;
        size_t l = strlen(d);
        int literal;
        char *p2;
        size_t l = strlen(d);
        int literal;
-       int fnm_flags= ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0) | FNM_PERIOD;
+       int fnm_flags= ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
+               | ((!(flags & GLOB_PERIOD)) ? FNM_PERIOD : 0);
        int error;
 
        if ((p2 = strchr(p, '/'))) {
        int error;
 
        if ((p2 = strchr(p, '/'))) {