This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GLOB_NOCHECK broken in some cases?


This test case shows glob's GLOB_NOCHECK appears to be broken in some
cases. Can someone confirm that this is a bug and not just a
misunderstanding of the expected behavior?

The test returns 0 for the glob() call, and 0 for gl_pathc, aswell as a
NULL in gl_pathv[0]. My assumption (and the reporter of this bug) is
that it should return 0 for the glob() call, and gl_pathc=1 with the
orignal match in gl_pathv[0].


Ben

-- 
 .----------=======-=-======-=========-----------=====------------=-=-----.
/                   Ben Collins    --    Debian GNU/Linux                  \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'
#include <glob.h>

int main() {
        glob_t pglob;
        printf("%d\n", glob("*./a", GLOB_NOCHECK, 0, &pglob));
        printf("%d\n", pglob.gl_pathc);
        printf("%s\n", pglob.gl_pathv[0]);
        return 0;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]