- static int contains_back_to_back_doubles(const char *word) {
- char last = '\0';
- while(*word) {
- if(*word == last) { /* Found first double */
- if(!(last = *++word))
- break;
- if(*++word == last) { /* Found second double */
- if(!(last = *++word))
- break;
- if(*++word == last) /* Found third double */
- return 1;
- }
- }
- last = *word++;
- }
- return 0;
- }