2002-06-02 00:40:43 +00:00
|
|
|
#include "str.h"
|
2001-02-02 17:54:47 +00:00
|
|
|
|
|
|
|
/* 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;
|
|
|
|
}
|