1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
16 |
|
|
17 |
|
#include "resolu.h" |
18 |
|
|
19 |
+ |
#include "paths.h" |
20 |
+ |
|
21 |
|
VIEW stdview = STDVIEW; /* default view parameters */ |
22 |
|
|
23 |
|
|
378 |
|
isview(s) /* is this a view string? */ |
379 |
|
char *s; |
380 |
|
{ |
381 |
< |
static char *altname[]={NULL,"rpict","rview","pinterp",VIEWSTR,NULL}; |
382 |
< |
extern char *progname, *rindex(); |
381 |
> |
static char *altname[]={NULL,VIEWSTR,"rpict","rview","pinterp",NULL}; |
382 |
> |
extern char *progname; |
383 |
|
register char *cp; |
384 |
|
register char **an; |
385 |
|
/* add program name to list */ |
386 |
< |
if (altname[0] == NULL) |
387 |
< |
if ((cp = rindex(progname, '/')) != NULL) |
388 |
< |
altname[0] = cp+1; |
389 |
< |
else |
390 |
< |
altname[0] = progname; |
386 |
> |
if (altname[0] == NULL) { |
387 |
> |
for (cp = progname; *cp; cp++) |
388 |
> |
; |
389 |
> |
while (cp > progname && !ISDIRSEP(cp[-1])) |
390 |
> |
cp--; |
391 |
> |
altname[0] = cp; |
392 |
> |
} |
393 |
|
/* skip leading path */ |
394 |
|
cp = s; |
395 |
|
while (*cp && *cp != ' ') |
396 |
|
cp++; |
397 |
< |
while (cp > s && cp[-1] != '/') |
397 |
> |
while (cp > s && !ISDIRSEP(cp[-1])) |
398 |
|
cp--; |
399 |
|
for (an = altname; *an != NULL; an++) |
400 |
|
if (!strncmp(*an, cp, strlen(*an))) |