OpenBSD CVS

CVS log for src/usr.bin/sort/file.c


[BACK] Up to [local] / src / usr.bin / sort

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.23 / (download) - annotate - [select for diffs], Mon Dec 30 16:07:13 2019 UTC (4 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, HEAD
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored) to selected 1.11 (colored)

Do not perform top-level sort when -c is used with a -k field.
From Richard Ipsum

Revision 1.22 / (download) - annotate - [select for diffs], Wed May 15 09:07:46 2019 UTC (5 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored) to selected 1.11 (colored)

Cleanup:
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@

Revision 1.21 / (download) - annotate - [select for diffs], Mon Oct 17 02:58:29 2016 UTC (7 years, 7 months ago) by lteo
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored) to selected 1.11 (colored)

/var/tmp -> /tmp

From Jan Stary.
"POSIX doesn't restrict us here" and ok schwarze@

Revision 1.20 / (download) - annotate - [select for diffs], Fri Apr 3 10:37:24 2015 UTC (9 years, 2 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.19: +9 -28 lines
Diff to previous 1.19 (colored) to selected 1.11 (colored)

The combination of -c and -o is not specified by POSIX. In fact, the call
"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@

Revision 1.19 / (download) - annotate - [select for diffs], Thu Apr 2 22:14:51 2015 UTC (9 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored) to selected 1.11 (colored)

murder excessive whitespace

Revision 1.18 / (download) - annotate - [select for diffs], Thu Apr 2 21:04:06 2015 UTC (9 years, 2 months ago) by tobias
Branch: MAIN
Changes since 1.17: +1 -2 lines
Diff to previous 1.17 (colored) to selected 1.11 (colored)

Global variable free_memory is only used in sort.c's set_hw_params,
so turn it into a local one.

ok millert@

Revision 1.17 / (download) - annotate - [select for diffs], Thu Apr 2 12:48:28 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.16: +22 -33 lines
Diff to previous 1.16 (colored) to selected 1.11 (colored)

No need for the umask() dance now that temp files are created
with mkstemp().  Also remove useless else after a return.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Apr 2 12:21:18 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.15: +2 -8 lines
Diff to previous 1.15 (colored) to selected 1.11 (colored)

When using mmap() we don't need to keep the open fd around, closing
the fd does not unmap the region.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Apr 2 12:19:51 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.14: +2 -3 lines
Diff to previous 1.14 (colored) to selected 1.11 (colored)

closefile() already checks for stdin so no need to check in the caller.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Apr 1 22:43:16 2015 UTC (9 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.13: +7 -1 lines
Diff to previous 1.13 (colored) to selected 1.11 (colored)

Block signals during tmp_files insertion, so that the signal handler
cannot encounter an incoherent list.  It was an absolutely tiny signal
race.
ok millert

Revision 1.13 / (download) - annotate - [select for diffs], Wed Apr 1 22:24:02 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.11 (colored)

Just use sort_reallocarray() everywhere.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Apr 1 21:33:01 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.11: +212 -255 lines
Diff to previous 1.11 (colored)

Remove some unneeded NULL checks that don't really help anything.
It is better to crash when given bad input rather than producing
a wrong result.  None of the checks can actually be triggered.

Revision 1.11 / (download) - annotate - [selected], Wed Apr 1 21:27:18 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

Let reallocarray do the multiplication for us.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Apr 1 21:22:41 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.9: +3 -2 lines
Diff to previous 1.9 (colored) to selected 1.11 (colored)

Use reallocarray.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Apr 1 21:16:17 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.8: +3 -5 lines
Diff to previous 1.8 (colored) to selected 1.11 (colored)

No need for if (x) free(x) style checks, this is not K&R.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Apr 1 20:58:13 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.7: +1 -25 lines
Diff to previous 1.7 (colored) to selected 1.11 (colored)

Style nits, remove whitespace at the start of a function.

Revision 1.7 / (download) - annotate - [select for diffs], Wed Apr 1 20:17:56 2015 UTC (9 years, 2 months ago) by tobias
Branch: MAIN
Changes since 1.6: +6 -5 lines
Diff to previous 1.6 (colored) to selected 1.11 (colored)

Use mkstemp to generate a new temporary file name.

ok millert

Revision 1.6 / (download) - annotate - [select for diffs], Wed Apr 1 19:06:18 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.5: +4 -6 lines
Diff to previous 1.5 (colored) to selected 1.11 (colored)

Remove unused len variable.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Mar 31 19:50:54 2015 UTC (9 years, 2 months ago) by tobias
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored) to selected 1.11 (colored)

Remove a useless use of cat.

ok millert

Revision 1.4 / (download) - annotate - [select for diffs], Mon Mar 30 19:59:07 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.3: +4 -9 lines
Diff to previous 1.3 (colored) to selected 1.11 (colored)

Use sort_asprintf()

Revision 1.3 / (download) - annotate - [select for diffs], Fri Mar 20 00:26:38 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.2: +1 -36 lines
Diff to previous 1.2 (colored) to selected 1.11 (colored)

Remove custom getdelim(3) and fix a small memory leak.  From Andre Smagin.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Mar 17 17:49:27 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.1: +2 -3 lines
Diff to previous 1.1 (colored) to selected 1.11 (colored)

Add sort_calloc() and use it.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Mar 17 17:45:13 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Diff to selected 1.11 (colored)

Initial import of FreeBSD sort.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.