Use our own string-routines "strindex" and "strrindex". At least we
authorceriel <none@none>
Mon, 20 Oct 1986 13:52:16 +0000 (13:52 +0000)
committerceriel <none@none>
Mon, 20 Oct 1986 13:52:16 +0000 (13:52 +0000)
know their name!

util/ack/main.c
util/ack/run.c
util/ack/trans.c

index c1e7a4a..e4432de 100644 (file)
@@ -251,7 +251,7 @@ vieuwargs(argc,argv) char **argv ; {
 firstarg(argp) register char *argp ; {
        register char *name ;
 
-       name=rindex(argp,'/') ;
+       name=strrindex(argp,'/') ;
        if ( name && *(name+1) ) {
                name++ ;
        } else {
@@ -270,7 +270,7 @@ process(arg) char *arg ; {
 #ifdef DEBUG
        if ( debug ) vprint("Processing %s\n",arg) ;
 #endif
-       p_suffix= rindex(arg,SUFCHAR) ;
+       p_suffix= strrindex(arg,SUFCHAR) ;
        orig.p_keep= YES ;      /* Don't throw away the original ! */
        orig.p_keeps= NO;
        orig.p_path= arg ;
index b46769b..2ea332d 100644 (file)
@@ -45,7 +45,7 @@ int runphase(phase) register trf *phase ; {
                        vprint("%s",phase->t_name) ;
                        if ( !phase->t_combine ) {
                                vprint(" %s%s\n",p_basename,
-                                       rindex(in.p_path,SUFCHAR) ) ;
+                                       strrindex(in.p_path,SUFCHAR) ) ;
                        } else {
                                scanlist(l_first(phase->t_inputs), elem) {
                                        vprint(" %s",p_cont(*elem)->p_path);
index 8d01625..d1b4aa0 100644 (file)
@@ -168,9 +168,9 @@ set_Rflag(argp) register char *argp ; {
        register int length ;
        char *eq, *colon ;
 
-       eos= index(&argp[2],'-');
-       eq= index(&argp[2],EQUAL) ;
-       colon= index(&argp[2],':');
+       eos= strindex(&argp[2],'-');
+       eq= strindex(&argp[2],EQUAL) ;
+       colon= strindex(&argp[2],':');
        if ( !eos ) {
                eos= eq ;
        } else {
@@ -479,7 +479,7 @@ int mapexpand(mapentry,cflag)
        register char *space ;
        int length ;
 
-       star=index(mapentry,STAR) ;
+       star=strindex(mapentry,STAR) ;
        space=firstblank(mapentry) ;
        if ( star >space ) star= (char *)0 ;
        if ( star ) {
@@ -523,7 +523,7 @@ doassign(line,star,length) char *line, *star ; {
        for ( ; *ptr && *ptr!=SPACE && *ptr!=TAB && *ptr!=EQUAL ; ptr++ ) {
                gr_add(&name,*ptr) ;
        }
-       ptr= index(ptr,EQUAL) ;
+       ptr= strindex(ptr,EQUAL) ;
        if ( !ptr ) {
                error("Missing %c in assignment %s",EQUAL,line);
                return ;
@@ -611,7 +611,7 @@ addargs(string) char *string ; {
        register char *temp, *repc ;
        register list_elem *elem ;
 
-       repc=index(string,C_IN) ;
+       repc=strindex(string,C_IN) ;
        if ( repc ) {
                /* INPUT FILE TOKEN seen, replace it and scan further */
                if ( repc==string && string[1]==0 ) {
@@ -637,7 +637,7 @@ addargs(string) char *string ; {
                }
                return ;
        }
-       repc=index(string,C_OUT) ;
+       repc=strindex(string,C_OUT) ;
        if ( repc ) {
                /* replace the outfile token as with the infile token */
 #ifdef DEBUG