- } else
- np = path;
- kbytes = descend(path, *np ? np : ".");
- if (sflg)
- printf("%ld\t%s\n", kbytes, path);
+ if (pid != 0)
+ wait((int *)0);
+ }
+ if (argc == 1 || pid == 0) {
+ (void) strcpy(path, *argv);
+ (void) strcpy(name, *argv);
+ if (np = rindex(name, '/')) {
+ *np++ = '\0';
+ if (chdir(*name ? name : "/") < 0) {
+ perror(*name ? name : "/");
+ exit(1);
+ }
+ } else
+ np = path;
+ kbytes = descend(path, *np ? np : ".");
+ if (sflg)
+ printf("%ld\t%s\n", kbytes, path);
+ if (argc > 1)
+ exit(1);
+ }