From b8d01591928acf7640dcb4c3652320a07c3c2ddb Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Tue, 8 Dec 2015 15:30:56 +0000 Subject: [PATCH] fix freadptr to work with ungetc on all uClibc configs This was noticed at https://bugs.busybox.net/show_bug.cgi?id=4099 where GNU coreutils cut fails like: $echo '3:0:0:' | cut -d : -f 2 30 The reason is because GNU cut uses ungetc(), and that wasn't handled appropriately on uClibc when __UCLIBC_HAS_STDIO_GETC_MACRO__ is not defined. * lib/freadptr.c (freadptr): Return NULL if there are ungotten chars. In this case freadseek() will iterate again to process the ungotten character. --- ChangeLog | 10 ++++++++++ lib/freadptr.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index fffa98a306..13f49662b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2015-12-08 Pádraig Brady
+
+ fix freadptr to work with ungetc on all uClibc configs
+ Reported at https://bugs.busybox.net/show_bug.cgi?id=4099
+ where GNU coreutils cut(1) generates invalid output on uClibc
+ when __UCLIBC_HAS_STDIO_GETC_MACRO__ is not defined.
+ * lib/freadptr.c (freadptr): Return NULL if there are
+ ungotten chars. In this case freadseek() will iterate
+ again to process the ungotten character.
+
2015-11-13 Paul Eggert