dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f94080
)
Set conv_fails on total conversion failure too.
author
Peter Verthez
<Peter.Verthez@advalvas.be>
Sun, 27 Oct 2002 15:47:49 +0000
(15:47 +0000)
committer
Peter Verthez
<Peter.Verthez@advalvas.be>
Sun, 27 Oct 2002 15:47:49 +0000
(15:47 +0000)
utf8/utf8-locale.c
patch
|
blob
|
history
diff --git
a/utf8/utf8-locale.c
b/utf8/utf8-locale.c
index 6db205bd762778d4c1f3ea0c00db957ca35f82e6..9d58b625db3c47eae95f13604e682502c26dcd71 100644
(file)
--- a/
utf8/utf8-locale.c
+++ b/
utf8/utf8-locale.c
@@
-70,8
+70,10
@@
char* convert_utf8_to_locale(const char* input, int *conv_fails)
char *outptr;
size_t nconv;
char *outptr;
size_t nconv;
- if (utf8_to_locale == (iconv_t) -1 && (open_conversion_contexts() == -1))
+ if (utf8_to_locale == (iconv_t) -1 && (open_conversion_contexts() == -1)) {
+ if (conv_fails != NULL) *conv_fails = insize;
return NULL;
return NULL;
+ }
assert(utf8_to_locale != (iconv_t) -1);
/* make sure we start from an empty state */
iconv(utf8_to_locale, NULL, NULL, NULL, NULL);
assert(utf8_to_locale != (iconv_t) -1);
/* make sure we start from an empty state */
iconv(utf8_to_locale, NULL, NULL, NULL, NULL);
@@
-113,6
+115,7
@@
char* convert_utf8_to_locale(const char* input, int *conv_fails)
else {
/* EINVAL should not happen, since we convert entire strings */
/* EBADF is an error which should be captured by the assert above */
else {
/* EINVAL should not happen, since we convert entire strings */
/* EBADF is an error which should be captured by the assert above */
+ if (conv_fails != NULL) *conv_fails += insize;
return NULL;
}
nconv = iconv(utf8_to_locale, &inptr, &insize, &outptr, &outsize);
return NULL;
}
nconv = iconv(utf8_to_locale, &inptr, &insize, &outptr, &outsize);