projects
/
debian
/
tar
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import upstream version 1.29
[debian/tar]
/
gnu
/
mbrtowc.c
diff --git
a/gnu/mbrtowc.c
b/gnu/mbrtowc.c
index 50e37b9754094fb1e1abe0831dcf57f3532f3e74..e49d55b3b1037dfdd7cab83f9be98fe8aa53ec56 100644
(file)
--- a/
gnu/mbrtowc.c
+++ b/
gnu/mbrtowc.c
@@
-1,7
+1,5
@@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Convert multibyte character to wide character.
/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-201
4
Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-201
5
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
@@
-330,7
+328,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_ARG2_BUG || MBRTOWC_RETVAL_BUG
+# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG
|| MBRTOWC_EMPTY_INPUT_BUG
if (s == NULL)
{
pwc = NULL;
if (s == NULL)
{
pwc = NULL;
@@
-339,6
+337,11
@@
rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
}
# endif
}
# endif
+# if MBRTOWC_EMPTY_INPUT_BUG
+ if (n == 0)
+ return (size_t) -2;
+# endif
+
# if MBRTOWC_RETVAL_BUG
{
static mbstate_t internal_state;
# if MBRTOWC_RETVAL_BUG
{
static mbstate_t internal_state;