/*(@(#)getpath.c 1.2 /ra/csr/presotto/hacks/src/worm/sccs/s.getpath.c)*/
int npaths
; /* number of paths to search */
char *paths
[MAXPATHS
]; /* pointers to the paths */
char thepath
[256]; /* where to copy path */
* input the execution search path
path
= (char *)getenv ("PATH");
for (npaths
= 0; npaths
< MAXPATHS
; npaths
++) {
while (*path
!= ':' && *path
!= 0) path
++;
* see if we can execute a command
char *path
; /* path to the command */
char abspath
[MAXPATHSIZE
];
int rv
; /* return value */
int indp
; /* path index */
/* absolute path, don't fool around */
/* relative path, do some work */
for (indp
= 0; indp
< npaths
; indp
++) {
strcpy (abspath
, paths
[indp
]);