int p0 = -333;
int c0;
int did_white = FALSE;
+ int wordlen;
+
/*
* Convert the multi-byte string to a wide-character string.
* Remove accents, if wanted. We actually remove all non-word characters.
* But keep white space.
*/
- n = 0;
+ wordlen = 0;
for (s = inword; *s != NUL; )
{
t = s;
continue;
}
}
- word[n++] = c;
+ word[wordlen++] = c;
}
- word[n] = NUL;
+ word[wordlen] = NUL;
/*
- * This comes from Aspell phonet.cpp.
+ * This algorithm comes from Aspell phonet.cpp.
* Converted from C++ to C. Added support for multi-byte chars.
* Changed to keep spaces.
*/
}
if (k > k0)
mch_memmove(word + i + k0, word + i + k,
- sizeof(int) * (STRLEN(word + i + k) + 1));
+ sizeof(int) * (wordlen - (i + k) + 1));
/* new "actual letter" */
c = word[i];
if (c != NUL)
wres[reslen++] = c;
mch_memmove(word, word + i + 1,
- sizeof(int) * (STRLEN(word + i + 1) + 1));
+ sizeof(int) * (wordlen - (i + 1) + 1));
i = 0;
z0 = 1;
}