Fw: [PATCH]: (newlib) Allow wcschr(x, L'\0')
J. Johnston
jjohnstn@redhat.com
Mon Mar 17 17:14:00 GMT 2003
Patch applied. Thanks. No paperwork needed.
-- Jeff J.
Bob Cassels wrote:
> ----- Forwarded by Bob Cassels/AbInitio on 03/14/03 11:29 PM -----
>
> Bob Cassels <bcassels@abinitio.com>
> Sent by: cygwin-patches-owner@cygwin.com
> 03/14/03 02:46 PM
>
> To
> cygwin-patches@cygwin.com
> cc
>
> Subject
> [PATCH]: (newlib) Allow wcschr(x, L'\0')
>
>
>
>
>
>
> This simple patch for newlib allows using wcschr to find pointers to null
> characters, rather than returning NULL. I hope it's simple enough to not
> require paperwork.
>
> 2003-03-14 Bob Cassels <bcassels@abinitio.com>
>
> * libc/string/wcschr.c: (wcschr): Look for character first, then
> for
> end of string, so you can do wcschr(x, '\0').
>
>
>
> ForwardSourceID:NT00007C62
>
>
> ------------------------------------------------------------------------
>
> Index: libc/string/wcschr.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/string/wcschr.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 wcschr.c
> --- libc/string/wcschr.c 3 Sep 2002 19:52:10 -0000 1.2
> +++ libc/string/wcschr.c 14 Mar 2003 19:35:01 -0000
> @@ -69,14 +69,13 @@ _DEFUN (wcschr, (s, c),
> _CONST wchar_t *p;
>
> p = s;
> - while (*p)
> + do
> {
> if (*p == c)
> {
> /* LINTED interface specification */
> return (wchar_t *) p;
> }
> - p++;
> - }
> + } while (*p++);
> return NULL;
> }
More information about the Newlib
mailing list