<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/nl.c, branch v9.0</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v9.0</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v9.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2021-08-22T20:10:26Z</updated>
<entry>
<title>maint: use clearerr on stdin when appropriate</title>
<updated>2021-08-22T20:10:26Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-08-22T18:54:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=88846befff58d181c5f77d50ec4b11980af16563'/>
<id>urn:sha1:88846befff58d181c5f77d50ec4b11980af16563</id>
<content type='text'>
This is so that commands like ‘fmt - -’ read from stdin
both times, even when it is a tty.  Fix some other minor
issues that are related.
* src/blake2/b2sum.c (main):
* src/cksum.c (cksum):
* src/cut.c (cut_file):
* src/expand-common.c (next_file):
* src/fmt.c (fmt):
* src/fold.c (fold_file):
* src/md5sum.c (digest_file, digest_check):
* src/nl.c (nl_file):
* src/od.c (check_and_close):
* src/paste.c (paste_parallel, paste_serial):
* src/pr.c (close_file):
* src/sum.c (bsd_sum_file):
Use clearerr on stdin so that stdin can be read multiple times
even if it is a tty.  Do not assume that ferror preserves errno as
POSIX does not guarantee this.  Coalesce duplicate diagnostic
calls.
* src/blake2/b2sum.c (main):
* src/fmt.c (main, fmt):
Report read error, even if it's merely fclose failure.
* src/fmt.c: Include die.h.
(fmt): New arg FILE.  Close input (reporting error) if not stdin.
All callers changed.
* src/ptx.c (swallow_file_in_memory): Clear stdin's EOF flag.
* src/sort.c (xfclose): Remove unnecessary feof call.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2021-01-01T16:36:09Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-01-01T16:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=32ff1d1313ff566685b9092ac929251a4c22e7c4'/>
<id>urn:sha1:32ff1d1313ff566685b9092ac929251a4c22e7c4</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>nl: fix --section-delimiter handling of single characters</title>
<updated>2020-12-15T14:11:55Z</updated>
<author>
<name>KOBAYASHI Takashi</name>
<email>a1415tk@aiit.ac.jp</email>
</author>
<published>2020-12-14T16:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=567fc2c2ad7b70d9c053413bd1a918f93bc41670'/>
<id>urn:sha1:567fc2c2ad7b70d9c053413bd1a918f93bc41670</id>
<content type='text'>
* src/nl.c (main): Enforce the POSIX specified
behavior of assuming ':' is specified after a single
character argument to -d.
* tests/misc/nl.sh: Add a test case.
* NEWS: Mention the bug fix.
</content>
</entry>
<entry>
<title>doc: mention the GNU extensions to nl --section-delimiter</title>
<updated>2020-12-15T14:11:51Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-12-15T01:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1935528ce9eba1df285dc05fbb8cf3c083334078'/>
<id>urn:sha1:1935528ce9eba1df285dc05fbb8cf3c083334078</id>
<content type='text'>
* doc/coreutils.texi (nl invocation): Mention the GNU extensions
of allowing arbitrary length and empty delimiter strings.
* src/nl.c (usage): Likewise.
* tests/misc/nl.sh: Add test cases for the GNU extensions.
</content>
</entry>
<entry>
<title>maint: refactor nl section delimiter handling</title>
<updated>2020-12-15T13:17:39Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-12-15T01:02:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b0d527fb40bd7a36ab90af891a1934daff1f3475'/>
<id>urn:sha1:b0d527fb40bd7a36ab90af891a1934daff1f3475</id>
<content type='text'>
* src/nl.c (main): Update the default delimiter characters
when passed two characters with --section-delimiter.
Avoid redundant copies for the body and footer delimiter strings,
and instead, just offset into the header string.
(check_section): Avoid redundant comparing of 2 bytes of memory
for an empty delimiter.
</content>
</entry>
<entry>
<title>nl: support a negative --line-increment</title>
<updated>2020-10-26T13:15:46Z</updated>
<author>
<name>KOBAYASHI Takashi</name>
<email>a1415tk@aiit.ac.jp</email>
</author>
<published>2020-10-25T17:09:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2c898597ea54b439369f0e3fabc6373729e1ea85'/>
<id>urn:sha1:2c898597ea54b439369f0e3fabc6373729e1ea85</id>
<content type='text'>
* src/nl.c (main): Allow -i to accept down to INTMAX_MIN.
* tests/misc/nl.sh: Add test cases.
* NEWS: Mention the new feature.
</content>
</entry>
<entry>
<title>nl: only fail if need to output overflowed numbers</title>
<updated>2020-10-25T16:57:19Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-10-25T16:40:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=fe41d6c651eb0044e1d152b13f413874ba6bd731'/>
<id>urn:sha1:fe41d6c651eb0044e1d152b13f413874ba6bd731</id>
<content type='text'>
Previously we would have failed immediately upon internal overflow,
which didn't output the full line being processed, and assumed
there would be another numbered line.

* src/nl.c (line_no_overflow): A new global to track overflow.
(print_lineno): Only fail if about to output an overflowed number.
(reset_lineno): A new function to refactor resetting of the number,
and which also clears line_no_overflow.
* tests/misc/nl.sh: Add a test case.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2020-01-01T14:16:56Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-01-01T14:16:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=aaba82431ceca97441d56152d8c7ec2d84fa1d12'/>
<id>urn:sha1:aaba82431ceca97441d56152d8c7ec2d84fa1d12</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>nl: fix integer-overflow bug</title>
<updated>2019-10-03T19:41:51Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2019-10-03T19:37:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ac2b4a43e679a3984dbdb42f141ef0af9c0f7903'/>
<id>urn:sha1:ac2b4a43e679a3984dbdb42f141ef0af9c0f7903</id>
<content type='text'>
Problem reported by Roland Illig (Bug#37585)
* src/nl.c (print_lineno): Don’t rely on undefined behavior when
checking for integer overflow.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2019-01-01T23:51:48Z</updated>
<author>
<name>Assaf Gordon</name>
<email>assafgordon@gmail.com</email>
</author>
<published>2019-01-01T23:50:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8dfcf38af1280c34d7c02b1bbed151368f6de211'/>
<id>urn:sha1:8dfcf38af1280c34d7c02b1bbed151368f6de211</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
</feed>
