Hello, Thomas!
Sorry for so late reply, we are working on 3.2.x branch now,
so I just had no time to check your function. It works fine
and I replaced the old one by your version. It will appear
in 3.1.13 release which will be available this week. At least
we hope so. Thatk you very much for contribution!
Thomas Olsson wrote:
>
> Hi,
>
> Thanks for a very nice program :-)
>
> I've got a small contribution, since I found a bug in mnogosearch 3.1.12
> and fixed it. It is the hilightcpy() function in search.c. This function
> chops off the last char if the input string ends in a single "word"
> character. E.g. a title string called "RFC 7" will be output as "RFC ".
>
> I must admit I couldn't be bothered to work out exactly why it didn't
> work, so I just wrote a replacement. You can decide yourself if you want
> to fix the original bug, or use this replacement. I've been using it for
> some time now, and it does seem to work.
>
> I've tried to keep the style from the code, though it is pretty far from
> my usual formatting :-)
>
> static char *hilightcpy(int LCharset, char *dst, char *src, char *w_list, char
>*start, char *stop) {
> char *t = dst, *s = src, *word = src;
> char real_word[64];
>
> if (*s) {
> do {
> if (!UdmWordChar(*s, LCharset)) {
> if (word < s) {
> char save = *s;
> *s = 0;
> sprintf(real_word, " %.61s ", word);
> UdmTolower(real_word, LCharset);
> if (strstr(w_list, real_word)) {
> sprintf(t, "%s%s%s", start, word,
>stop);
> }else{
> strcpy(t, word);
> }
> t += strlen(t);
> *t++ = *s++ = save;
> word = s;
> }else{
> *t++ = *s++;
> word++;
> }
> }else{
> s++;
> }
> } while (s[-1]);
> }
> *t = 0;
> return dst;
> }
>
> Regards,
> Thomas
>
> --
> Thomas Olsson
> http://www.armware.dk/
>
> ___________________________________________
> If you want to unsubscribe send "unsubscribe general"
> to [EMAIL PROTECTED]
___________________________________________
If you want to unsubscribe send "unsubscribe general"
to [EMAIL PROTECTED]