}
}
+int _strrcmp (char *str1, char *str2)
+{
+ int ret = 0;
+ int l1 = strlen (str1);
+ int l2 = strlen (str2);
+ int l = (l1 < l2) ? l1 : l2;
+ int i;
+ for (i = 0; i < l; i++) {
+ if (str1[i] != '.') {
+ ret = str1[i] - str2[i];
+ if (ret != 0) {
+ break;
+ }
+ }
+ }
+ if (ret == 0) {
+ ret = str1[l] - str2[l];
+ }
+ return ret;
+}
+
void checkspellingfromfile (word_t *words, char *dict)
{
FILE *fd = (dict) ? fopen (dict, "r") : NULL;
int stop = 1;
for (i = 0; i < words->maxnbwords; i++) {
if (words->status[i] == notchecked) {
- if (strcmp (words->tab[i], str) == 0) {
+ if (_strrcmp (words->tab[i], str) == 0) {
words->status[i] = correct;
} else {
stop = 0;
int stop = 1;
for (i = 0; i < words->maxnbwords; i++) {
if (words->status[i] == notchecked) {
- if (strcmp (words->tab[i], *listofwords) == 0) {
+ if (_strrcmp (words->tab[i], *listofwords) == 0) {
words->status[i] = correct;
} else {
stop = 0;