Subversion Repositories Kolibri OS

Rev

Rev 8793 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include "unconst.h"
  3. #include <string.h>
  4.  
  5. char* strstr(const char* s, const char* find)
  6. {
  7.     char c, sc;
  8.     size_t len;
  9.  
  10.     if ((c = *find++) != 0) {
  11.         len = strlen(find);
  12.         do {
  13.             do {
  14.                 if ((sc = *s++) == 0)
  15.                     return 0;
  16.             } while (sc != c);
  17.         } while (strncmp(s, find, len) != 0);
  18.         s--;
  19.     }
  20.     return unconst(s, char*);
  21. }
  22.