summaryrefslogtreecommitdiffstats
path: root/usr.bin/sort (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Usually, -width Fl (which is 10n) is too wide and hence ugly.schwarze2020-01-161-3/+3
| | | | Change several instances, most of them to the usual -width Ds.
* Do not perform top-level sort when -c is used with a -k field.millert2019-12-301-2/+3
| | | | From Richard Ipsum
* More Version 1 AT&T UNIX history.schwarze2019-09-061-3/+3
| | | | | | This became possible because copies of the original v1 manuals have shown up on the Internet some time ago. Reminded by Sevan Janiyan <venture37 at geeklan dot co dot uk>.
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-3/+3
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* In manpages, don't escape apostrophes as \'; it's rarely what you want.bentley2019-06-021-5/+9
| | | | | Most of these are correct just as '. A few benefit from Ql or \(aq. But if in doubt, just use '.
* re-indent bwscoll() after previous commit; no binary changeschwarze2019-05-151-79/+79
|
* Cleanup:schwarze2019-05-155-144/+21
| | | | | | | | | | | | | | | Delete handling of LC_COLLATE (which has no effect) and delete support for non-ASCII single-byte encodings, allowing to replace the condition byte_sort == 1 with sort_mb_cur_max == 1. Since none of our single-byte character and string functions are locale dependent, also zap inspection of LC_CTYPE while here. For know, keep the code supporting multi-byte encodings even though it is very ugly, it cannot be reached right now, and we have no plans to enable it any time soon. OK millert@ tb@
* Delete tentacles of LC_NUMERIC support.schwarze2019-05-134-106/+9
| | | | | | Our libc doesn't support that now and won't in the future. Minus ~90 lines of code, no functional change. OK tb@
* short option comes first, followed by the corresponding long optionanton2019-02-241-3/+3
| | | | ok jmc@
* add missing blanks before several delimiters; found with mandoc -Tlintschwarze2017-06-101-10/+10
|
* Fix a crash when "sort -m" is given no files. From Julien Ramseier.millert2017-01-041-2/+5
|
* /var/tmp -> /tmplteo2016-10-172-6/+6
| | | | | From Jan Stary. "POSIX doesn't restrict us here" and ok schwarze@
* missing .Fl macro, from Jan Staryschwarze2016-10-111-3/+7
|
* make several program to use "chown" promise.semarie2016-07-141-3/+3
| | | | | | | | | | | | | | | | it allows chown(2) call to change the user or group on a file. - usr.bin/compress : aka gzip - usr.bin/mg : open a file for writing - usr.bin/sed : inplace editing - usr.bin/sort : if outfile equals one of the input files ok deraadt@ tb@ (and a reminder from Remi Locherer) warning: in order to use it, you must have a recent kernel with the new promise.
* No need for sysexits.h here.millert2015-12-312-4/+2
|
* Use %zu to print size_t's rather than casting to int.mmcc2015-12-111-3/+3
| | | | ok millert@
* The default modifier should be copied for empty keys even if -b ismillert2015-10-241-5/+6
| | | | specified. From Cedric Krier.
* Do not warn for sort -o if we can't chown the output temporary filemillert2015-10-181-6/+4
| | | | to match the owner of the output file.
* Pledge; OK millert@ tobias@tim2015-10-171-33/+70
|
* Copy permissions AND ownership when -o will override an input file.tobias2015-10-141-4/+8
| | | | with input by and ok deraadt@, millert@, tim@
* Ignore the setuid/setgid/sticky bits when copying the permissions of an inputtim2015-10-131-2/+2
| | | | | | file to the new output file. In preparation for pledge(2). Suggested by and OK millert@
* -C and -c allow at most one input file. Ensure this is the case when thetim2015-10-131-6/+6
| | | | | | input files are specified through --files0-from. OK millert@
* Document that some sorts uses -b w/o key fields.millert2015-04-051-1/+12
|
* For the -g flag, treat non-floating point keys as 0, similar to -n.millert2015-04-051-6/+18
| | | | | This makes "sort -gu" and "sort -nu" behave similarly and passes our sort regress tests.
* The -b flag should only apply when key fields are specified.millert2015-04-053-13/+24
| | | | If -b follows -k it has no effect.
* Do not permute command line arguments but still support themillert2015-04-052-7/+24
| | | | obsolescent "-o outfile" after input files syntax.
* Only one input file is allowed with the -c/-C flags.millert2015-04-031-1/+5
|
* The combination of -c and -o is not specified by POSIX. In fact, the calltobias2015-04-032-36/+17
| | | | | | | | | | | | | "sort -o file -c file" has unspecified behavior and would leave an empty file behind if it was sorted, the original file it was not. If -c (or -C) has been specified, only perform that action and ignore -o among other arguments. While at it, clean up check() internals. with input by and ok millert@
* If -S has been supplied multiple times, only take last one into account.tobias2015-04-031-4/+7
| | | | | | Without this patch, multiple -S arguments influence each other. spotted by and ok millert@
* murder excessive whitespacederaadt2015-04-023-8/+8
|
* Prevent integer overflow when parsing -S argument as percentage.tobias2015-04-021-1/+7
| | | | | | | Also make sure that the parsed memory amount, stored in a long long, won't be larger than SIZE_MAX to properly support 32 bit systems. with input by and ok millert@
* Global variable free_memory is only used in sort.c's set_hw_params,tobias2015-04-023-6/+7
| | | | | | so turn it into a local one. ok millert@
* Fixed whitespace issues.tobias2015-04-022-5/+5
| | | | ok millert@
* Zap some more NULL checks in front of free.tobias2015-04-022-11/+7
| | | | ok millert@
* No need to strdup environment variable or command line arguments here.tobias2015-04-021-5/+5
| | | | ok millert@
* Add signal name instead of array index (which is not the signal number)tobias2015-04-021-2/+2
| | | | | | to sigaction error message. with input by and ok millert@
* Don't need to include stdint.hmillert2015-04-021-2/+1
|
* No need for the umask() dance now that temp files are createdmillert2015-04-021-30/+19
| | | | with mkstemp(). Also remove useless else after a return.
* Don't install signal handlers for SIGQUIT, SIGVTALRM, SIGPROF.millert2015-04-021-3/+3
|
* When using mmap() we don't need to keep the open fd around, closingmillert2015-04-021-9/+3
| | | | the fd does not unmap the region.
* closefile() already checks for stdin so no need to check in the caller.millert2015-04-021-3/+2
|
* Check for overflow when handling buffer size suffixes.millert2015-04-011-2/+20
|
* Block signals during tmp_files insertion, so that the signal handlerderaadt2015-04-011-1/+7
| | | | | | cannot encounter an incoherent list. It was an absolutely tiny signal race. ok millert
* Use reallocarray instead of malloc.millert2015-04-011-2/+3
|
* Just use sort_reallocarray() everywhere.millert2015-04-014-19/+7
|
* Revert unintentional commit. This will be revisited shortly.millert2015-04-011-3/+1
|
* Style nits, remove whitespace at the start of a function.millert2015-04-012-6/+4
|
* Remove some unneeded NULL checks that don't really help anything.millert2015-04-011-130/+111
| | | | | It is better to crash when given bad input rather than producing a wrong result. None of the checks can actually be triggered.
* Use exit value 2 for mutually exclusive option errors.millert2015-04-011-5/+11
|
* Fix typo in revision 1.55millert2015-04-011-2/+2
|