OSDN Git Service

allow for runtime testing
authorMike Frysinger <vapier@gentoo.org>
Tue, 14 Feb 2006 03:34:43 +0000 (03:34 -0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 14 Feb 2006 03:34:43 +0000 (03:34 -0000)
test/misc/dirent.c

index f8832f6..c8db2c8 100644 (file)
@@ -18,12 +18,12 @@ const char const *types[] = {
        _DTIFY(DT_WHT)
 };
 
-int main(int argc, char **argv)
+int main(int argc, char *argv[])
 {
        DIR *dirh;
        struct dirent *de;
        struct dirent64 *de64;
-       const char const mydir[] = ".";
+       const char *mydir = (argc == 1 ? "/" : argv[1]);
 
        if ((dirh = opendir(mydir)) == NULL) {
                perror("opendir");