Use our own string-routines "strindex" and "strrindex". At least we
know their name!
This commit is contained in:
parent
784bd9ec54
commit
11d442c0a0
3 changed files with 10 additions and 10 deletions
|
@ -251,7 +251,7 @@ vieuwargs(argc,argv) char **argv ; {
|
||||||
firstarg(argp) register char *argp ; {
|
firstarg(argp) register char *argp ; {
|
||||||
register char *name ;
|
register char *name ;
|
||||||
|
|
||||||
name=rindex(argp,'/') ;
|
name=strrindex(argp,'/') ;
|
||||||
if ( name && *(name+1) ) {
|
if ( name && *(name+1) ) {
|
||||||
name++ ;
|
name++ ;
|
||||||
} else {
|
} else {
|
||||||
|
@ -270,7 +270,7 @@ process(arg) char *arg ; {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ( debug ) vprint("Processing %s\n",arg) ;
|
if ( debug ) vprint("Processing %s\n",arg) ;
|
||||||
#endif
|
#endif
|
||||||
p_suffix= rindex(arg,SUFCHAR) ;
|
p_suffix= strrindex(arg,SUFCHAR) ;
|
||||||
orig.p_keep= YES ; /* Don't throw away the original ! */
|
orig.p_keep= YES ; /* Don't throw away the original ! */
|
||||||
orig.p_keeps= NO;
|
orig.p_keeps= NO;
|
||||||
orig.p_path= arg ;
|
orig.p_path= arg ;
|
||||||
|
|
|
@ -45,7 +45,7 @@ int runphase(phase) register trf *phase ; {
|
||||||
vprint("%s",phase->t_name) ;
|
vprint("%s",phase->t_name) ;
|
||||||
if ( !phase->t_combine ) {
|
if ( !phase->t_combine ) {
|
||||||
vprint(" %s%s\n",p_basename,
|
vprint(" %s%s\n",p_basename,
|
||||||
rindex(in.p_path,SUFCHAR) ) ;
|
strrindex(in.p_path,SUFCHAR) ) ;
|
||||||
} else {
|
} else {
|
||||||
scanlist(l_first(phase->t_inputs), elem) {
|
scanlist(l_first(phase->t_inputs), elem) {
|
||||||
vprint(" %s",p_cont(*elem)->p_path);
|
vprint(" %s",p_cont(*elem)->p_path);
|
||||||
|
|
|
@ -168,9 +168,9 @@ set_Rflag(argp) register char *argp ; {
|
||||||
register int length ;
|
register int length ;
|
||||||
char *eq, *colon ;
|
char *eq, *colon ;
|
||||||
|
|
||||||
eos= index(&argp[2],'-');
|
eos= strindex(&argp[2],'-');
|
||||||
eq= index(&argp[2],EQUAL) ;
|
eq= strindex(&argp[2],EQUAL) ;
|
||||||
colon= index(&argp[2],':');
|
colon= strindex(&argp[2],':');
|
||||||
if ( !eos ) {
|
if ( !eos ) {
|
||||||
eos= eq ;
|
eos= eq ;
|
||||||
} else {
|
} else {
|
||||||
|
@ -479,7 +479,7 @@ int mapexpand(mapentry,cflag)
|
||||||
register char *space ;
|
register char *space ;
|
||||||
int length ;
|
int length ;
|
||||||
|
|
||||||
star=index(mapentry,STAR) ;
|
star=strindex(mapentry,STAR) ;
|
||||||
space=firstblank(mapentry) ;
|
space=firstblank(mapentry) ;
|
||||||
if ( star >space ) star= (char *)0 ;
|
if ( star >space ) star= (char *)0 ;
|
||||||
if ( star ) {
|
if ( star ) {
|
||||||
|
@ -523,7 +523,7 @@ doassign(line,star,length) char *line, *star ; {
|
||||||
for ( ; *ptr && *ptr!=SPACE && *ptr!=TAB && *ptr!=EQUAL ; ptr++ ) {
|
for ( ; *ptr && *ptr!=SPACE && *ptr!=TAB && *ptr!=EQUAL ; ptr++ ) {
|
||||||
gr_add(&name,*ptr) ;
|
gr_add(&name,*ptr) ;
|
||||||
}
|
}
|
||||||
ptr= index(ptr,EQUAL) ;
|
ptr= strindex(ptr,EQUAL) ;
|
||||||
if ( !ptr ) {
|
if ( !ptr ) {
|
||||||
error("Missing %c in assignment %s",EQUAL,line);
|
error("Missing %c in assignment %s",EQUAL,line);
|
||||||
return ;
|
return ;
|
||||||
|
@ -611,7 +611,7 @@ addargs(string) char *string ; {
|
||||||
register char *temp, *repc ;
|
register char *temp, *repc ;
|
||||||
register list_elem *elem ;
|
register list_elem *elem ;
|
||||||
|
|
||||||
repc=index(string,C_IN) ;
|
repc=strindex(string,C_IN) ;
|
||||||
if ( repc ) {
|
if ( repc ) {
|
||||||
/* INPUT FILE TOKEN seen, replace it and scan further */
|
/* INPUT FILE TOKEN seen, replace it and scan further */
|
||||||
if ( repc==string && string[1]==0 ) {
|
if ( repc==string && string[1]==0 ) {
|
||||||
|
@ -637,7 +637,7 @@ addargs(string) char *string ; {
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
repc=index(string,C_OUT) ;
|
repc=strindex(string,C_OUT) ;
|
||||||
if ( repc ) {
|
if ( repc ) {
|
||||||
/* replace the outfile token as with the infile token */
|
/* replace the outfile token as with the infile token */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Reference in a new issue