[BACK]Return to util.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/Attic/util.c between version 1.10 and 1.11

version 1.10, 1998/12/20 23:38:11 version 1.11, 1999/11/11 11:35:17
Line 420 
Line 420 
         return rv;          return rv;
 }  }
 #endif  #endif
   
   #ifdef NEED_STRSTR
   char *
   strstr(string, substring)
           const char *string;             /* String to search. */
           const char *substring;          /* Substring to find in string */
   {
           const char *a, *b;
   
           /*
            * First scan quickly through the two strings looking for a single-
            * character match.  When it's found, then compare the rest of the
            * substring.
            */
   
           for (b = substring; *string != 0; string += 1) {
                   if (*string != *b)
                           continue;
                   a = string;
                   for (;;) {
                           if (*b == 0)
                                   return (char *)string;
                           if (*a++ != *b++)
                                   break;
                   }
                   b = substring;
           }
           return NULL;
   }
   #endif

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11