- bool direct_dependencies = FALSE;
- bool invert_dependencies = FALSE;
- bool header = FALSE;
- int i, c, debug_level = 0;
- int code;
-
- if ((_nc_progname = strrchr(argv[0], '/')) == NULL)
- _nc_progname = argv[0];
- else
- _nc_progname++;
+ if (path != 0) {
+ struct stat sb;
+ if (stat(path, &sb) != 0
+ || (sb.st_mode & S_IFMT) != S_IFDIR
+ || access(path, R_OK | X_OK) != 0)
+ path = 0;
+ }
+ return path;
+}
+
+int
+main(int argc, char *argv[])
+{
+ bool direct_dependencies = FALSE;
+ bool invert_dependencies = FALSE;
+ bool header = FALSE;
+ int i, c;
+ int code;
+
+ _nc_progname = _nc_basename(argv[0]);