Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
424 B

#include "str.h"
/* str_start returns 1 if the b is a prefix of a, 0 otherwise */
int str_start(const char* a, const char* b) {
register const char* s=a;
register const char* t=b;
for (;;) {
if (!*t) return 1; if (*s!=*t) break; ++s; ++t;
if (!*t) return 1; if (*s!=*t) break; ++s; ++t;
if (!*t) return 1; if (*s!=*t) break; ++s; ++t;
if (!*t) return 1; if (*s!=*t) break; ++s; ++t;
}
return 0;
}