<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests, branch v8.7</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.7</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2010-11-11T07:16:24Z</updated>
<entry>
<title>csplit: do not rely on undefined behavior in printf formats</title>
<updated>2010-11-11T07:16:24Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2010-11-11T04:34:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6568b173db1c98f39a53eadd9b09e0a0e5c11920'/>
<id>urn:sha1:6568b173db1c98f39a53eadd9b09e0a0e5c11920</id>
<content type='text'>
* doc/coreutils.texi (csplit invocation): Say that %d and %i are
aliases for %u.
* src/csplit.c (FLAG_THOUSANDS, FLAG_ALTERNATIVE): New constants.
(get_format_flags): Now take char const * and int * and return
size_t.  It now stores info about the flags instead of merely
scanning them.  Also, it handles '0' correctly.  Drop support for
the undocumented '+' and ' ' flags since the value is unsigned.
Add support for the (undocumented) "'" flag.  All uses changed.
(get_format_width, get_format_prec): Remove.
(check_format_conv_type): Renamed from get_format_conv_type, with
a different signature.  It now converts the format to one that is
compatible with unsigned int, and checks flags.  All uses changed.
(max_out): Have snprintf compute the number of bytes needed rather
than attempting to do it ourselves (which doesn't work portably
with outlandish formats such as %4294967296d).
(check_format_conv_type, main): Check for overflow in size
calculations.  Don't assume size_t fits in unsigned int.
* tests/misc/csplit: Check for proper handling of flags, with
%0#6.3x.  Coreutils 8.6 mishandles this somewhat-weird example.
</content>
</entry>
<entry>
<title>csplit: fix a memory leak per input buffer</title>
<updated>2010-11-11T01:40:12Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2010-11-10T14:35:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0339eb4598600024cedca14a7e882c1737dd2d82'/>
<id>urn:sha1:0339eb4598600024cedca14a7e882c1737dd2d82</id>
<content type='text'>
* src/csplit.c (free_buffer): Also free the line offsets buffers
(remove_line): Also free the containing structure
* tests/misc/csplit-heap: A new test to trigger with leaks of
this magnitude.
* tests/Makefile.am: Reference the new test
* NEWS: Mention the fix
Reported by David Hofstee
</content>
</entry>
<entry>
<title>tests: fix comments and --version invocation in new test</title>
<updated>2010-11-10T21:08:05Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-10T20:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=7727908335ef1049deac42851026ed8bf5ae2734'/>
<id>urn:sha1:7727908335ef1049deac42851026ed8bf5ae2734</id>
<content type='text'>
* tests/misc/csplit-1000: Fix comments and --version invocation.
</content>
</entry>
<entry>
<title>csplit: avoid buffer overrun when writing more than 999 files</title>
<updated>2010-11-10T13:28:03Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-10T12:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0cfd4f2161de5e942cbd7c273d03a90c1dfd2062'/>
<id>urn:sha1:0cfd4f2161de5e942cbd7c273d03a90c1dfd2062</id>
<content type='text'>
Without this fix, seq 1000 | csplit - /./ '{*}' would write
the NUL-terminated file name, xx1000, into a buffer of size 6.
* src/csplit.c (main): Use properly sized file name buffer.
* NEWS (Bug fixes): Mention it.
* tests/misc/csplit-1000: New test to trigger the bug.
* tests/Makefile.am (TESTS): Add misc/csplit-1000.
</content>
</entry>
<entry>
<title>tests: avoid portability problem with dash vs. symlinked ttys</title>
<updated>2010-11-09T12:43:20Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2010-11-09T12:43:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=425503c8073a17df5ace9bb9330ce283804b07e1'/>
<id>urn:sha1:425503c8073a17df5ace9bb9330ce283804b07e1</id>
<content type='text'>
* tests/mv/i-3: Adjust so that the symlink is resolved
before redirecting to the background command, as otherwise
the stdin descriptor passed to the command will fail the
isatty() or ttyname() test.
</content>
</entry>
<entry>
<title>tests: avoid portability problem with dash vs. local v=$splittable_val</title>
<updated>2010-11-08T10:26:08Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2010-11-08T10:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4a14a80bd1a88dde4e361aa259264a54c4ffa3ea'/>
<id>urn:sha1:4a14a80bd1a88dde4e361aa259264a54c4ffa3ea</id>
<content type='text'>
* tests/init.cfg (retry_delay_): Adjust awk script to print a single
floating point value, rather than many.
</content>
</entry>
<entry>
<title>tests: don't disqualify FreeBSD 8.1's /bin/sh just yet,</title>
<updated>2010-11-07T20:08:37Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-07T13:23:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=dd45755406861fc192284d7e2b28f3c33e0433d3'/>
<id>urn:sha1:dd45755406861fc192284d7e2b28f3c33e0433d3</id>
<content type='text'>
because dash-0.5.6-2.fc14.x86_64 would also be disqualified.
This reverts part of yesterday's commit 6c058b2d, "tests: avoid
failure due to bug in FreeBSD 8.1's /bin/sh".  Note that the offending
aspect of those shells is not officially a bug, since "local" is not
specified by POSIX.  However, it is very unintuitive that prepending
"local" to an existing, standards-compliant assignment would evoke
such a fundamental change in semantics.
* tests/init.sh: Remove snippet requiring sane "local" support.
Upstream dash bug report:
http://thread.gmane.org/gmane.comp.shells.dash/419
</content>
</entry>
<entry>
<title>stat: do not rely on undefined behavior in printf formats</title>
<updated>2010-11-07T01:09:44Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2010-11-06T20:57:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ca9aa7596094c4af094edb7eb63648570d53c100'/>
<id>urn:sha1:ca9aa7596094c4af094edb7eb63648570d53c100</id>
<content type='text'>
* src/stat.c (digits, printf_flags): New static vars.
(make_format): New function.
(out_string, out_int, out_uint, out_uint_o, out_uint_x):
(out_minus_zero): Use it to avoid undefined behavior when invoking
printf.
(print_it): Check for invalid conversion specifications such as
%..X and %1-X, which would otherwise rely on undefined behavior
when invoking printf.
* tests/misc/stat-nanoseconds: Check that the "I" printf flag
doesn't mess up in the C locale, as it formerly did on non-GNU
hosts.
</content>
</entry>
<entry>
<title>tests: avoid failure due to bug in FreeBSD 8.1's /bin/sh</title>
<updated>2010-11-06T14:24:53Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-06T14:20:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6c058b2dabe2e577d56e8c2c82cec550ff82f085'/>
<id>urn:sha1:6c058b2dabe2e577d56e8c2c82cec550ff82f085</id>
<content type='text'>
* tests/init.sh: Arrange not to accept FreeBSD 8.1's /bin/sh, since
it fails this test: /bin/sh -c 'f(){ local s=$IFS; test -n "$s"; }; f'
* tests/init.cfg (sanitize_path_): Stop-gap measure to work around
a bug in FreeBSD 8.1's /bin/sh.  We'll un-do this change once all
300+ tests use init.sh.
</content>
</entry>
<entry>
<title>stat: use e.g. %.3X instead of %X.%3:X for sub-second precision</title>
<updated>2010-11-06T14:24:49Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2010-11-06T02:35:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c7375c236ca5fa23661388e9f9c41e8312eb0cce'/>
<id>urn:sha1:c7375c236ca5fa23661388e9f9c41e8312eb0cce</id>
<content type='text'>
* NEWS: Document this.
* doc/coreutils.texi (stat invocation): Likewise.
* gl/lib/fstimeprec.c, gl/lib/fstimeprec.h, gl/modules/fstimeprec:
* gl/modules/fstimeprec-tests, gl/tests/test-fstimeprec.c:
New files.
* bootstrap.conf (gnulib_modules): Add fstimeprec.
* src/stat.c: Include fstimeprec.h.  Don't include xstrtol.h.
(decimal_point, decimal_point_len): New static vars.
(main): Initialize them.
(epoch_sec, out_ns): Remove.
(out_int, out_uint): Now returns whatever printf returned.
(out_minus_zero, out_epoch_secs): New functions.
(print_stat): Use out_epoch_sec instead of out_ns and epoch_sec.
(print_stat, print_it, usage): Remove the %:X-style formats.
* tests/misc/stat-nanoseconds: Set TZ=UTC0 to avoid problems
with weird time zones.  Use a time stamp near the Epoch so that we
don't have to worry about leap seconds.  Redo test cases to match
new behavior.
* tests/touch/60-seconds: Change %Y.%:Y to %.9Y, to adjust to
new behavior.
</content>
</entry>
</feed>
