Page MenuHomeFreeBSD

D34342.id103109.diff
No OneTemporary

D34342.id103109.diff

Index: usr.bin/iconv/iconv.c
===================================================================
--- usr.bin/iconv/iconv.c
+++ usr.bin/iconv/iconv.c
@@ -77,9 +77,16 @@
unsigned long long invalids;
size_t inbytes, outbytes, ret;
- int arg = (int)hide_invalid;
- if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1)
- err(EXIT_FAILURE, "iconvctl(DISCARD_ILSEQ, %d)", arg);
+ /*
+ * Don't touch ICONV_SET_DISCARD_ILSEQ if -c wasn't specified. It may
+ * be that the user has specified //IGNORE in the -t specification, and
+ * we don't want to clobber that.
+ */
+ if (hide_invalid) {
+ int arg = (int)hide_invalid;
+ if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1)
+ err(EXIT_FAILURE, "iconvctl(DISCARD_ILSEQ, %d)", arg);
+ }
invalids = 0;
while ((inbytes = fread(inbuf, 1, INBUFSIZE, fp)) > 0) {

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 6:13 AM (6 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30746756
Default Alt Text
D34342.id103109.diff (842 B)

Event Timeline