On Thu, Jul 28, 2005 at 08:54:53AM -0400, Jon Smirl wrote: > On 7/28/05, Mitchell Blank Jr <[email protected]> wrote: > > Greg KH wrote: > > > > + /* locate trailng white space */ > > > > + z = y = x; > > > > + while (y - buffer->page < count) { > > > > + y++; > > > > + z = y; > > > > + while (isspace(*y) && (y - buffer->page < count)) { > > > > + y++; > > > > + } > > > > + } > > > > + count = z - x; > > > > > > Hm, I _think_ this works, but I need someone else to verify this... > > > Anyone else? > > > > It looks sane-ish to me, but also more complicated than need be. Why can't > > you just do something like: > > > > while (count > 0 && isspace(x[count - 1])) > > count--; > > > > -Mitch > > > > Do we need to deal with UTF8 here? I did the forward loop because you > can't parse UTF8 backwards. If UTF8 is possible I need to change the > pointer inc function. No, we don't need to handle UTF8. Or if we do, then we better not make a general filter function, as it will be a mess. thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- References:
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Greg KH <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Jon Smirl <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Jon Smirl <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Greg KH <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Jon Smirl <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Greg KH <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Jon Smirl <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Greg KH <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Mitchell Blank Jr <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- From: Jon Smirl <[email protected]>
- Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- Prev by Date: Re: v850, which gcc and binutils version?
- Next by Date: Re: 2.6.13-rc3-mm3
- Previous by thread: Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- Next by thread: Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
- Index(es):