projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix breakage when user overrides CFLAGS on the make command line
[musl]
/
src
/
locale
/
iconv.c
diff --git
a/src/locale/iconv.c
b/src/locale/iconv.c
index
e6121ae
..
1eeea94
100644
(file)
--- a/
src/locale/iconv.c
+++ b/
src/locale/iconv.c
@@
-5,6
+5,7
@@
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
+#include "locale_impl.h"
#define UTF_32BE 0300
#define UTF_16LE 0301
#define UTF_32BE 0300
#define UTF_16LE 0301
@@
-165,9
+166,12
@@
size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restr
int err;
unsigned char type = map[-1];
unsigned char totype = tomap[-1];
int err;
unsigned char type = map[-1];
unsigned char totype = tomap[-1];
+ locale_t *ploc = &CURRENT_LOCALE, loc = *ploc;
if (!in || !*in || !*inb) return 0;
if (!in || !*in || !*inb) return 0;
+ *ploc = UTF8_LOCALE;
+
for (; *inb; *in+=l, *inb-=l) {
c = *(unsigned char *)*in;
l = 1;
for (; *inb; *in+=l, *inb-=l) {
c = *(unsigned char *)*in;
l = 1;
@@
-431,6
+435,7
@@
size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restr
break;
}
}
break;
}
}
+ *ploc = loc;
return x;
ilseq:
err = EILSEQ;
return x;
ilseq:
err = EILSEQ;
@@
-445,5
+450,6
@@
starved:
x = -1;
end:
errno = err;
x = -1;
end:
errno = err;
+ *ploc = loc;
return x;
}
return x;
}