summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/misc/dirent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/misc/dirent.c b/test/misc/dirent.c
index f8832f6bd..c8db2c83d 100644
--- a/test/misc/dirent.c
+++ b/test/misc/dirent.c
@@ -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");