<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/sort.c, branch v8.22</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.22</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.22'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2013-11-27T01:21:23Z</updated>
<entry>
<title>sort: avoid issues when issuing diagnostics from child processes</title>
<updated>2013-11-27T01:21:23Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-26T02:47:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=39e0c9ba5d7a37401a30e1304282142e525e334c'/>
<id>urn:sha1:39e0c9ba5d7a37401a30e1304282142e525e334c</id>
<content type='text'>
* src/sort.c: (async_safe_die): A new limited version of error(),
that outputs fixed strings and unconverted errnos to stderr.
This is safe to call in the limited context of a signal handler,
or in this particular case, between the fork() and exec() of
a multithreaded process.
(move_fd_or_die): Use the async_safe_die() rather than error().
(maybe_create_temp): Likewise.
(open_temp): Likewise.
Fixes http://bugs.gnu.org/15970
</content>
</entry>
<entry>
<title>maint: update out of date confusing comments</title>
<updated>2013-09-01T17:44:04Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-09-01T17:40:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0603ff3784c353cf096a02b825f76fd3a08ac756'/>
<id>urn:sha1:0603ff3784c353cf096a02b825f76fd3a08ac756</id>
<content type='text'>
* src/copy.c (copy_internal): Change mention of the removed --reply=no
option, to the similar in this context --no-clobber.
* src/sort.c: SI and IEC suffixes can now be mixed when --human-numeric.
</content>
</entry>
<entry>
<title>maint: port --enable-gcc-warnings to clang</title>
<updated>2013-05-19T00:55:07Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2013-05-19T00:49:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=478dade09a4288f73e963b7f185ef9f73b681b42'/>
<id>urn:sha1:478dade09a4288f73e963b7f185ef9f73b681b42</id>
<content type='text'>
* configure.ac: If clang, add -Wno-format-extra-args and
-Wno-tautological-constant-out-of-range-compare.
* gl/lib/rand-isaac.c (ind):
* gl/lib/randread.c (readisaac):
* src/ls.c (dev_ino_push, dev_ino_pop):
* src/sort.c (buffer_linelim):
* src/system.h (is_nul):
* src/tail.c (tail_forever_inotify):
Rewrite to avoid casts that clang dislikes.
It's good to avoid casts anyway.
* src/expr.c (integer_overflow): Declare only if it exists.
(die): Remove; unused.
* src/ls.c (dev_ino_push): New function, replacing ...
(DEV_INO_PUSH): ... this removed macro.  All uses changed.
(decode_switches): Rewrite "str"+i to &amp;str[i].
</content>
</entry>
<entry>
<title>maint: define usage note about mandatory args centrally</title>
<updated>2013-01-23T00:03:38Z</updated>
<author>
<name>Bernhard Voelker</name>
<email>mail@bernhard-voelker.de</email>
</author>
<published>2013-01-23T00:03:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4eaadb47430f21aee83eb920378be01945845a9a'/>
<id>urn:sha1:4eaadb47430f21aee83eb920378be01945845a9a</id>
<content type='text'>
Each program with at least one long option which is marked as
'required_argument' and which has also a short option for that
option, should print a note about mandatory arguments.
Define that well-known note centrally and use it rather than
literal printf/fputs, and add it where it was missing.

* src/system.h (emit_mandatory_arg_note): Add new function.

* src/cp.c (usage): Use it rather than literal printf/fputs.
* src/csplit.c, src/cut.c, src/date.c, src/df.c, src/du.c:
* src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/install.c:
* src/kill.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c:
* src/mknod.c, src/mv.c, src/nl.c, src/od.c, src/paste.c:
* src/pr.c, src/ptx.c, src/shred.c, src/shuf.c, src/sort.c:
* src/split.c, src/stdbuf.c, src/tac.c, src/tail.c, src/timeout.c:
* src/touch.c, src/truncate.c, src/unexpand.c, src/uniq.c:
Likewise.

* src/base64.c (usage): Add call of the above new function
because at least one long option has a required argument.
* src/basename.c, src/chcon.c, src/date.c, src/env.c:
* src/nice.c, src/runcon.c, src/seq.c, src/stat.c, src/stty.c:
Likewise.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2013-01-01T03:51:20Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2013-01-01T02:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=77da73c75432f3c5b4beebae7b0797a1e33160bc'/>
<id>urn:sha1:77da73c75432f3c5b4beebae7b0797a1e33160bc</id>
<content type='text'>
Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.
</content>
</entry>
<entry>
<title>sort: simpler fix for sort -u data-loss bug, and for a FMR bug</title>
<updated>2012-08-18T05:39:29Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2012-08-17T20:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=574b7c7dbec8821d03a462796968847783d07c29'/>
<id>urn:sha1:574b7c7dbec8821d03a462796968847783d07c29</id>
<content type='text'>
This also fixes a free-memory-read (FMR) bug: when fillbuf's realloc
of buf-&gt;buf frees the buffer into which saved_line.text points,
the processing of that just-read longer line includes comparison
against the saved line in freed memory.
* src/sort.c (overlap): Remove.
(fillbuf): Do not try to copy saved lines, as that is too risky
in the presence of parallelism, reallocated buffers, etc.
(sort): Invalidate any saved line before sorting a new batch.
</content>
</entry>
<entry>
<title>sort: sort --unique (-u) could cause data loss</title>
<updated>2012-08-17T07:52:19Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-08-15T10:30:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=eb3f5b3b3de8c6ca005a701f09bff43d778aece7'/>
<id>urn:sha1:eb3f5b3b3de8c6ca005a701f09bff43d778aece7</id>
<content type='text'>
sort -u could omit one or more lines of expected output.
This bug arose because sort recorded the most recently printed line via
reference, and if you were unlucky, the storage for that line would be
reused (overwritten) as additional input was read into memory.  If you
were doubly unlucky, the new value of the "saved" line would not only
match the very next line, but if that next line were also the first in
a series of identical, not-yet-printed lines, then the corrupted "saved"
line value would result in the omission of all matching lines.

* src/sort.c (saved_line): New static/global, renamed and moved from...
(write_unique): ...here.  Old name was "saved", which was too generic
for its new role as file-scoped global.
(fillbuf): With --unique, when we're about to read into a buffer that
overlaps the saved "preceding" line (saved_line), copy the line's .text
member to a realloc'd-as-needed temporary buffer and adjust the line's
key-defining members if they're set.
(overlap): New function.
* tests/misc/sort: New tests.
* NEWS (Bug fixes): Mention it.
* THANKS.in: Update.
Bug introduced via commit v8.5-89-g9face83.
Reported by Rasmus Borup Hansen in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/23173/focus=24647
</content>
</entry>
<entry>
<title>maint: correct a stale comment in sort.c</title>
<updated>2012-08-16T18:13:59Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-08-15T09:31:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1e987a9966122e08a0d47cfd75baf63302314ea8'/>
<id>urn:sha1:1e987a9966122e08a0d47cfd75baf63302314ea8</id>
<content type='text'>
* src/sort.c (fillbuf): Fix comment typo.  x2nrealloc no longer
doubles the size of its input buffer.
</content>
</entry>
<entry>
<title>sort: by default, do not exceed 3/4 of physical memory</title>
<updated>2012-07-10T23:16:33Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2012-07-10T23:14:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c2f590dc9a08dabcd18411bd4a4b85a0a82c2c08'/>
<id>urn:sha1:c2f590dc9a08dabcd18411bd4a4b85a0a82c2c08</id>
<content type='text'>
* src/sort.c (default_sort_size): Do not exceed 3/4 of total memory.
See Jeff Janes's bug report in
&lt;http://lists.gnu.org/archive/html/coreutils/2012-06/msg00018.html&gt;.
</content>
</entry>
<entry>
<title>sort: fix exit-status typo</title>
<updated>2012-07-02T23:46:59Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2012-07-02T23:19:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f3bd32bae2c902b9dbbe241884feaf2f0a4df7fa'/>
<id>urn:sha1:f3bd32bae2c902b9dbbe241884feaf2f0a4df7fa</id>
<content type='text'>
* src/sort.c (stream_open): EXIT_FAILURE -&gt; SORT_FAILURE.
Suggested by Pádraig Brady in &lt;http://bugs.gnu.org/11816#34&gt;.
</content>
</entry>
</feed>
