On Dec 30, 2007 3:50 PM, Marco Costalba [off-list ref] wrote:
If *prefix == "" case is to be considered I vote for your/Johannes
version because it's "better code" (tm).
Ok this is fast and correct
static inline int prefixcmp(const char *str, const char *prefix)
{
while (*str == *prefix && *prefix)
str++, prefix++;
return (*prefix ? *(unsigned const char *)prefix - *(unsigned const
char *)str : 0);
}
This is the last one, I promise ;-)
Marco