Fix trailing whitespace.
[glibc.git] / posix / bug-glob3.c
blobf2fbd703dd84aebad590d3c9882478bef2c032ea
1 #include <glob.h>
2 #include <stdio.h>
3 #include <string.h>
5 static int
6 do_test (void)
8 int result = 0;
9 glob_t g;
10 g.gl_pathc = 0;
12 int r = glob ("", 0, NULL, &g);
13 if (r != GLOB_NOMATCH)
15 puts ("glob (\"\", 0, NULL, &g) did not fail");
16 result = 1;
18 else if (g.gl_pathc != 0)
20 puts ("gl_pathc after glob (\"\", 0, NULL, &g) not zero");
21 result = 1;
24 r = glob ("", GLOB_NOCHECK, NULL, &g);
25 if (r != 0)
27 puts ("glob (\"\", GLOB_NOCHECK, NULL, &g) did fail");
28 result = 1;
30 else if (g.gl_pathc != 1)
32 puts ("gl_pathc after glob (\"\", GLOB_NOCHECK, NULL, &g) not 1");
33 result = 1;
35 else if (strcmp (g.gl_pathv[0], "") != 0)
37 puts ("gl_pathv[0] after glob (\"\", GLOB_NOCHECK, NULL, &g) not \"\"");
38 result = 1;
41 return result;
44 #define TEST_FUNCTION do_test ()
45 #include "../test-skeleton.c"