On Friday 25 February 2005 17:02, Hollis Blanchard wrote:
> int
> grub_strword (const char *haystack, const char *needle)
> {
>      int pos = 0;
>      int found = 0;
>
>      while (haystack[pos]) {
>          /* Advance to next word. */
>          while (grub_iswordseparator (haystack[pos]))
>              pos++;
>
>          if (0 == grub_strcmp (&haystack[pos], needle))
>              {
>                  found = 1;
>                  break;
>              }
>      }
>
>      return found;
> }

grub_strword ("filesystem", "file") returns 0 in your implementation.

If I write this function, I use grub_strstr and check if the previous 
character and the next character are boundaries.

Okuji


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to