projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NEWS.stable: log cherry-pick [27147dc]->[4c5d3e6] doc: update users.txt
[gnulib.git]
/
lib
/
mbrtowc.c
diff --git
a/lib/mbrtowc.c
b/lib/mbrtowc.c
index
5c2650e
..
0546f6d
100644
(file)
--- a/
lib/mbrtowc.c
+++ b/
lib/mbrtowc.c
@@
-1,5
+1,5
@@
/* Convert multibyte character to wide character.
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-201
0
Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-201
1
Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
@@
-91,7
+91,7
@@
mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
/* Here m > 0. */
/* Here m > 0. */
-# if __GLIBC__
+# if __GLIBC__
|| defined __UCLIBC__
/* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
mbtowc (NULL, NULL, 0);
# endif
/* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
mbtowc (NULL, NULL, 0);
# endif
@@
-321,7
+321,7
@@
mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
size_t
rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
{
size_t
rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
{
-# if MBRTOWC_NULL_ARG_BUG || MBRTOWC_RETVAL_BUG
+# if MBRTOWC_NULL_ARG
2
_BUG || MBRTOWC_RETVAL_BUG
if (s == NULL)
{
pwc = NULL;
if (s == NULL)
{
pwc = NULL;
@@
-379,7
+379,16
@@
rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
return ret;
}
# else
return ret;
}
# else
- return mbrtowc (pwc, s, n, ps);
+ {
+# if MBRTOWC_NULL_ARG1_BUG
+ wchar_t dummy;
+
+ if (pwc == NULL)
+ pwc = &dummy;
+# endif
+
+ return mbrtowc (pwc, s, n, ps);
+ }
# endif
}
# endif
}