about summary refs log tree commit diff
path: root/iconv/Makefile
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-09-20 13:10:54 +0200
committerFlorian Weimer <fweimer@redhat.com>2024-09-20 13:51:09 +0200
commit8ef3cff9d1ceafe369f982d980678d749fb93bd2 (patch)
tree10944be240ac4ed5aeeeb634c98e7836457a5d08 /iconv/Makefile
parent6cbf845fcdc76131d0e674cee454fe738b69c69d (diff)
downloadglibc-8ef3cff9d1ceafe369f982d980678d749fb93bd2.tar.gz
glibc-8ef3cff9d1ceafe369f982d980678d749fb93bd2.tar.xz
glibc-8ef3cff9d1ceafe369f982d980678d749fb93bd2.zip
iconv: Support in-place conversions (bug 10460, bug 32033)
Check if any of the input files overlaps with the output file, and use
a temporary file in this case, so that the input is no clobbered
before it is read.  This fixes bug 10460.  It allows to use iconv
more easily as a functional replacement for GNU recode.

The updated output buffer management truncates the output file
if there is no input, fixing bug 32033.

Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'iconv/Makefile')
-rw-r--r--iconv/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/iconv/Makefile b/iconv/Makefile
index 29e4f280ec..c9af0c4d44 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -81,6 +81,8 @@ include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
 ifeq ($(run-built-tests),yes)
 xtests-special += $(objpfx)test-iconvconfig.out
 tests-special += \
+	$(objpfx)tst-iconv_prog-buffer-large.out \
+	$(objpfx)tst-iconv_prog-buffer-tiny.out \
 	$(objpfx)tst-iconv_prog-buffer.out \
 	$(objpfx)tst-iconv_prog.out \
 	$(objpfx)tst-translit-mchar.out \
@@ -153,3 +155,12 @@ $(objpfx)tst-iconv_prog-buffer.out: \
   tst-iconv_prog-buffer.sh $(objpfx)iconv_prog
 	$(BASH) $< $(common-objdir) '$(test-program-prefix)' > $@; \
 	$(evaluate-test)
+$(objpfx)tst-iconv_prog-buffer-tiny.out: \
+  tst-iconv_prog-buffer.sh $(objpfx)iconv_prog
+	$(BASH) $< $(common-objdir) '$(test-program-prefix)' \
+	  '--buffer-size=1' > $@; \
+	$(evaluate-test)
+$(objpfx)tst-iconv_prog-buffer-large.out: \
+  tst-iconv_prog-buffer.sh $(objpfx)iconv_prog
+	$(BASH) $< $(common-objdir) '$(test-program-prefix)' '' '22' > $@; \
+	$(evaluate-test)