grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHv2] dprintf implementation


From: Yoshinori K. Okuji
Subject: Re: [PATCHv2] dprintf implementation
Date: Fri, 25 Feb 2005 18:12:03 +0100
User-agent: KMail/1.7.1

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]