<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/misc, 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>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>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>
<entry>
<title>stat: revert %X-%Y-%Z change; use e.g., %:X to print fractional seconds</title>
<updated>2010-11-03T12:10:50Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-10-21T16:41:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=db42ae787de7165ee3a1bbf8d4988d0698d7c1df'/>
<id>urn:sha1:db42ae787de7165ee3a1bbf8d4988d0698d7c1df</id>
<content type='text'>
This reverts part of the recent commit 9069af45,
"stat: print timestamps to full resolution", which made %X, %Y, %Z
print floating point numbers.  We prefer to retain portability of
%X, %Y and %Z uses, while still providing access to full-resolution
time stamps via modified format strings.  Also make the new
%W consistent.
* src/stat.c: Include "xstrtol.h".
(print_it): Accept a new %...:[XYZ] format directive,
e.g., %:X, to print the nanoseconds portion of the corresponding time.
For example, %3.3:Y prints the zero-padded, truncated, milliseconds
part of the time of last modification.
(print_it): Update print_func signature to match.
(neg_to_zero): New helper function.
(epoch_time): Remove function; replace with...
(epoch_sec): New function; use timetostr.
(out_ns): New function.  Use "09" only when no other modifier
is specified.
(print_statfs): Change type of "m" to unsigned int,
now that it must accommodate values larger than 255.
(print_stat): Likewise.
Map :X to a code of 'X' + 256.  Likewise for Y, Z and W.
(usage): Update.
* tests/touch/60-seconds: Use %Y.%:Y in place of %Y.
* tests/misc/stat-nanoseconds: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Changes in behavior): Mention this.
With improvements by Pádraig Brady.
Thanks to Andreas Schwab for raising the issue.
</content>
</entry>
<entry>
<title>tests: mention that btrfs also causes failure of misc/ls-time</title>
<updated>2010-10-26T16:14:50Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-10-26T14:34:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0d792d061e460fd5dfe6e4226f96bbc3b8788199'/>
<id>urn:sha1:0d792d061e460fd5dfe6e4226f96bbc3b8788199</id>
<content type='text'>
* tests/misc/ls-time: Mention that this test also fails on btrfs,
at least until http://bugzilla.redhat.com/591068 is addressed.
</content>
</entry>
<entry>
<title>tests: trigger and test for md5sum's new diagnostics</title>
<updated>2010-10-19T07:35:44Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-10-19T07:19:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=10a0bdfa986dc77b9c5b7171b701e77d02756759'/>
<id>urn:sha1:10a0bdfa986dc77b9c5b7171b701e77d02756759</id>
<content type='text'>
* tests/misc/md5sum: Test for new diagnostics.
</content>
</entry>
<entry>
<title>md5sum: print a summary warning for improperly formatted lines</title>
<updated>2010-10-19T07:32:38Z</updated>
<author>
<name>Benno Schulenberg</name>
<email>bensberg@justemail.net</email>
</author>
<published>2010-10-18T20:35:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=407806b27f032b3bce828ee0a152b5f67e997e09'/>
<id>urn:sha1:407806b27f032b3bce828ee0a152b5f67e997e09</id>
<content type='text'>
And remove the now-superfluous totals from the other two warnings,
so the plurals will also work in other languages than English.

* src/md5sum.c (digest_check): Change as above.
* tests/misc/md5sum (check-quiet2): Adjust accordingly.
</content>
</entry>
</feed>
