X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/2b84abb596f52ab2068d52108adc96838ad4340a..31cef89cb428866f787983e68246030321893df4:/usr/src/cmd/whereis.c diff --git a/usr/src/cmd/whereis.c b/usr/src/cmd/whereis.c index d839671183..a5faa8696d 100644 --- a/usr/src/cmd/whereis.c +++ b/usr/src/cmd/whereis.c @@ -1,7 +1,70 @@ +static char *sccsid = "@(#)whereis.c 4.1 (Berkeley) 10/1/80"; #include #include #include #include +#include + +static char *bindirs[] = { + "/etc", + "/bin", + "/usr/bin", + "/usr/games", +#ifdef CSVAX + "/lib", + "/usr/ucb", + "/usr/lib", + "/usr/local", + "/usr/new", + "/usr/old", +#endif +#ifdef CORY + "/usr/bin/eecs", + "/usr/bin/new", + "/usr/bin/v7", + "/usr/bin/old", + "/usr/bin/UNSUPPORTED", +#endif + 0 +}; +static char *mandirs[] = { + "/usr/man/man1", + "/usr/man/man2", + "/usr/man/man3", + "/usr/man/man4", + "/usr/man/man5", + "/usr/man/man6", + "/usr/man/man7", + "/usr/man/man8", +#ifdef CORY + "/usr/man/manu", + "/usr/man/manc", + "/usr/man/manv7", + "/usr/bin/eecs/mane", +#endif + 0 +}; +static char *srcdirs[] = { + "/usr/src/cmd", + "/usr/src/games", + "/usr/src/libc/gen", + "/usr/src/libc/stdio", +#ifdef CSVAX + "/usr/src/libc/sys", + "/usr/src/new", + "/usr/src/old", + "/usr/src/local", + "/usr/src/undoc", +#endif +#ifdef CORY + "/usr/bin/eecs/src", + "/usr/src/cmd/v7", + "/usr/src/cmd/new", + "/usr/src/cmd/old", + "/usr/src/cmd/UNSUPPORTED", +#endif + 0 +}; char sflag = 1; char bflag = 1; @@ -163,20 +226,7 @@ again: looksrc(cp) char *cp; { - static char *srcdirs[] = { - "cmd", - "libc/gen", - "libc/stdio", - "libc/sys", - "games", - "new", - "old", - "local", - "undoc", - 0 - }; if (Sflag == 0) { - chdir("/usr/src"); find(srcdirs, cp); } else findv(Sflag, Scnt, cp); @@ -185,19 +235,6 @@ looksrc(cp) lookbin(cp) char *cp; { - static char *bindirs[] = { - "/etc", - "/bin", - "/lib", - "/usr/bin", - "/usr/ucb", - "/usr/lib", - "/usr/local", - "/usr/new", - "/usr/old", - "/usr/games", - 0 - }; if (Bflag == 0) find(bindirs, cp); else @@ -207,19 +244,7 @@ lookbin(cp) lookman(cp) char *cp; { - static char *mandirs[] = { - "man1", - "man2", - "man3", - "man4", - "man5", - "man6", - "man7", - "man8", - 0 - }; if (Mflag == 0) { - chdir("/usr/man"); find(mandirs, cp); } else findv(Mflag, Mcnt, cp);