ls: omit some unnecessary NULs
[coreutils.git] / scripts / build-older-versions / coreutils-6.12-on-glibc-2.28.diff
blob6bcb650a741451e3f2f17c406b31cbbefe4e7742
1 diff -r -U3 coreutils-6.12/lib/freadahead.c coreutils-6.12-patched/lib/freadahead.c
2 --- coreutils-6.12/lib/freadahead.c 2008-05-14 06:53:25.000000000 -0600
3 +++ coreutils-6.12-patched/lib/freadahead.c 2019-08-01 17:50:52.731658318 -0600
4 @@ -24,7 +24,7 @@
5 size_t
6 freadahead (FILE *fp)
8 -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
9 +#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
10 if (fp->_IO_write_ptr > fp->_IO_write_base)
11 return 0;
12 return (fp->_IO_read_end - fp->_IO_read_ptr)
13 diff -r -U3 coreutils-6.12/lib/freadptr.c coreutils-6.12-patched/lib/freadptr.c
14 --- coreutils-6.12/lib/freadptr.c 2008-05-14 06:53:25.000000000 -0600
15 +++ coreutils-6.12-patched/lib/freadptr.c 2019-08-01 17:51:06.867856472 -0600
16 @@ -29,7 +29,7 @@
17 size_t size;
19 /* Keep this code in sync with freadahead! */
20 -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
21 +#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
22 if (fp->_IO_write_ptr > fp->_IO_write_base)
23 return NULL;
24 size = fp->_IO_read_end - fp->_IO_read_ptr;
25 diff -r -U3 coreutils-6.12/lib/freadseek.c coreutils-6.12-patched/lib/freadseek.c
26 --- coreutils-6.12/lib/freadseek.c 2008-05-14 06:53:25.000000000 -0600
27 +++ coreutils-6.12-patched/lib/freadseek.c 2019-08-01 17:51:21.264058094 -0600
28 @@ -34,7 +34,7 @@
29 freadptrinc (FILE *fp, size_t increment)
31 /* Keep this code in sync with freadptr! */
32 -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
33 +#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
34 fp->_IO_read_ptr += increment;
35 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
36 fp_->_p += increment;
37 diff -r -U3 coreutils-6.12/lib/fseterr.c coreutils-6.12-patched/lib/fseterr.c
38 --- coreutils-6.12/lib/fseterr.c 2008-05-14 06:53:25.000000000 -0600
39 +++ coreutils-6.12-patched/lib/fseterr.c 2019-08-01 17:51:36.668273645 -0600
40 @@ -29,7 +29,7 @@
41 /* Most systems provide FILE as a struct and the necessary bitmask in
42 <stdio.h>, because they need it for implementing getc() and putc() as
43 fast macros. */
44 -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
45 +#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
46 fp->_flags |= _IO_ERR_SEEN;
47 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
48 fp_->_flags |= __SERR;
49 diff -r -U3 coreutils-6.12/lib/stdio-impl.h coreutils-6.12-patched/lib/stdio-impl.h
50 --- coreutils-6.12/lib/stdio-impl.h 2008-05-14 06:53:25.000000000 -0600
51 +++ coreutils-6.12-patched/lib/stdio-impl.h 2019-08-01 17:49:51.518798189 -0600
52 @@ -18,6 +18,12 @@
53 the same implementation of stdio extension API, except that some fields
54 have different naming conventions, or their access requires some casts. */
56 +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
57 + * problem by defining it ourselves. FIXME: Do not rely on glibc
58 + * internals. */
59 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
60 +# define _IO_IN_BACKUP 0x100
61 +#endif
63 /* BSD stdio derived implementations. */