OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.90 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:03 2019 UTC (4 years, 10 months ago) by deraadt
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, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

When system calls indicate an error they return -1, not some arbitrary
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.

Revision 1.89 / (download) - annotate - [select for diffs], Wed May 15 09:07:46 2019 UTC (5 years ago) by schwarze
Branch: MAIN
Changes since 1.88: +2 -40 lines
Diff to previous 1.88 (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.88 / (download) - annotate - [select for diffs], Mon May 13 17:00:12 2019 UTC (5 years ago) by schwarze
Branch: MAIN
Changes since 1.87: +2 -57 lines
Diff to previous 1.87 (colored)

Delete tentacles of LC_NUMERIC support.
Our libc doesn't support that now and won't in the future.
Minus ~90 lines of code, no functional change.
OK tb@

Revision 1.87 / (download) - annotate - [select for diffs], Wed Jan 4 15:30:58 2017 UTC (7 years, 4 months ago) by millert
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.86: +5 -2 lines
Diff to previous 1.86 (colored)

Fix a crash when "sort -m" is given no files.  From Julien Ramseier.

Revision 1.86 / (download) - annotate - [select for diffs], Thu Jul 14 08:31:18 2016 UTC (7 years, 10 months ago) by semarie
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored)

make several program to use "chown" promise.

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.

Revision 1.85 / (download) - annotate - [select for diffs], Sat Oct 24 15:19:01 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.84: +6 -5 lines
Diff to previous 1.84 (colored)

The default modifier should be copied for empty keys even if -b is
specified.  From Cedric Krier.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Oct 18 17:02:03 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.83: +4 -6 lines
Diff to previous 1.83 (colored)

Do not warn for sort -o if we can't chown the output temporary file
to match the owner of the output file.

Revision 1.83 / (download) - annotate - [select for diffs], Sat Oct 17 14:33:01 2015 UTC (8 years, 7 months ago) by tim
Branch: MAIN
Changes since 1.82: +70 -33 lines
Diff to previous 1.82 (colored)

Pledge; OK millert@ tobias@

Revision 1.82 / (download) - annotate - [select for diffs], Wed Oct 14 16:42:51 2015 UTC (8 years, 7 months ago) by tobias
Branch: MAIN
Changes since 1.81: +8 -4 lines
Diff to previous 1.81 (colored)

Copy permissions AND ownership when -o will override an input file.

with input by and ok deraadt@, millert@, tim@

Revision 1.81 / (download) - annotate - [select for diffs], Tue Oct 13 16:55:03 2015 UTC (8 years, 7 months ago) by tim
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

Ignore the setuid/setgid/sticky bits when copying the permissions of an input
file to the new output file. In preparation for pledge(2).

Suggested by and OK millert@

Revision 1.80 / (download) - annotate - [select for diffs], Tue Oct 13 16:21:42 2015 UTC (8 years, 7 months ago) by tim
Branch: MAIN
Changes since 1.79: +6 -6 lines
Diff to previous 1.79 (colored)

-C and -c allow at most one input file. Ensure this is the case when the
input files are specified through --files0-from.

OK millert@

Revision 1.79 / (download) - annotate - [select for diffs], Sun Apr 5 13:56:04 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.78: +15 -9 lines
Diff to previous 1.78 (colored)

The -b flag should only apply when key fields are specified.
If -b follows -k it has no effect.

Revision 1.78 / (download) - annotate - [select for diffs], Sun Apr 5 13:54:06 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.77: +15 -5 lines
Diff to previous 1.77 (colored)

Do not permute command line arguments but still support the
obsolescent "-o outfile" after input files syntax.

Revision 1.77 / (download) - annotate - [select for diffs], Fri Apr 3 12:52:48 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.76: +5 -1 lines
Diff to previous 1.76 (colored)

Only one input file is allowed with the -c/-C flags.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Apr 3 10:37:24 2015 UTC (9 years, 1 month ago) by tobias
Branch: MAIN
Changes since 1.75: +8 -8 lines
Diff to previous 1.75 (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.75 / (download) - annotate - [select for diffs], Fri Apr 3 10:07:25 2015 UTC (9 years, 1 month ago) by tobias
Branch: MAIN
Changes since 1.74: +7 -4 lines
Diff to previous 1.74 (colored)

If -S has been supplied multiple times, only take last one into account.
Without this patch, multiple -S arguments influence each other.

spotted by and ok millert@

Revision 1.74 / (download) - annotate - [select for diffs], Thu Apr 2 21:09:51 2015 UTC (9 years, 1 month ago) by tobias
Branch: MAIN
Changes since 1.73: +7 -1 lines
Diff to previous 1.73 (colored)

Prevent integer overflow when parsing -S argument as percentage.
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@

Revision 1.73 / (download) - annotate - [select for diffs], Thu Apr 2 21:04:06 2015 UTC (9 years, 1 month ago) by tobias
Branch: MAIN
Changes since 1.72: +5 -2 lines
Diff to previous 1.72 (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.72 / (download) - annotate - [select for diffs], Thu Apr 2 21:00:08 2015 UTC (9 years, 1 month ago) by tobias
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Fixed whitespace issues.

ok millert@

Revision 1.71 / (download) - annotate - [select for diffs], Thu Apr 2 20:57:34 2015 UTC (9 years, 1 month ago) by tobias
Branch: MAIN
Changes since 1.70: +5 -5 lines
Diff to previous 1.70 (colored)

No need to strdup environment variable or command line arguments here.

ok millert@

Revision 1.70 / (download) - annotate - [select for diffs], Thu Apr 2 20:56:00 2015 UTC (9 years, 1 month ago) by tobias
Branch: MAIN
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (colored)

Add signal name instead of array index (which is not the signal number)
to sigaction error message.

with input by and ok millert@

Revision 1.69 / (download) - annotate - [select for diffs], Thu Apr 2 12:43:08 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (colored)

Don't install signal handlers for SIGQUIT, SIGVTALRM, SIGPROF.

Revision 1.68 / (download) - annotate - [select for diffs], Wed Apr 1 22:49:47 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.67: +20 -2 lines
Diff to previous 1.67 (colored)

Check for overflow when handling buffer size suffixes.

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

Just use sort_reallocarray() everywhere.

Revision 1.66 / (download) - annotate - [select for diffs], Wed Apr 1 21:45:50 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.65: +111 -130 lines
Diff to previous 1.65 (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.65 / (download) - annotate - [select for diffs], Wed Apr 1 21:41:59 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.64: +11 -5 lines
Diff to previous 1.64 (colored)

Use exit value 2 for mutually exclusive option errors.

Revision 1.64 / (download) - annotate - [select for diffs], Wed Apr 1 21:37:47 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Fix typo in revision 1.55

Revision 1.63 / (download) - annotate - [select for diffs], Wed Apr 1 21:21:38 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

Fix last instance of malloc(n * sizeof(char)) idiom.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Apr 1 21:18:43 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.61: +13 -15 lines
Diff to previous 1.61 (colored)

The argument to --sort is not optional so no need to check for NULL optarg.

Revision 1.61 / (download) - annotate - [select for diffs], Wed Apr 1 21:16:17 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.60: +5 -9 lines
Diff to previous 1.60 (colored)

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

Revision 1.60 / (download) - annotate - [select for diffs], Wed Apr 1 21:13:07 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.59: +33 -39 lines
Diff to previous 1.59 (colored)

No need for an else clause after a continue, it just makes the
code harder to read.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Apr 1 20:58:13 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.58: +1 -9 lines
Diff to previous 1.58 (colored)

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

Revision 1.58 / (download) - annotate - [select for diffs], Wed Apr 1 20:28:04 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.57: +9 -9 lines
Diff to previous 1.57 (colored)

If strtoul() fails to parse the argument to -k, just pass the
error back to the caller instead of calling err() directly.
The user gets a more useful error message this way.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Apr 1 20:24:12 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.56: +12 -12 lines
Diff to previous 1.56 (colored)

Use memcpy() not strncpy() when dynamically allocating and copying
a substring.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Apr 1 20:20:22 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.55: +13 -8 lines
Diff to previous 1.55 (colored)

Pass size of sopts buffer in to parse_pos_obs() for a length check and
use size_t not int for column and field vars.

Revision 1.55 / (download) - annotate - [select for diffs], Wed Apr 1 20:10:19 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.54: +39 -43 lines
Diff to previous 1.54 (colored)

Better range checking for "sort -S" memory size.

Revision 1.54 / (download) - annotate - [select for diffs], Wed Apr 1 19:56:01 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.53: +9 -8 lines
Diff to previous 1.53 (colored)

Use strtonum() to parse argument to --batch-size and document the
minimum value in the manual.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Mar 31 16:40:16 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.52: +7 -5 lines
Diff to previous 1.52 (colored)

Ignore TMPDIR environment variable if setuid or setgid.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Mar 31 12:16:02 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.51: +1 -4 lines
Diff to previous 1.51 (colored)

There's no good reason to make -m and -c mutually exclusive.
Other sorts don't care and our regress uses this.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Mar 31 11:46:26 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.50: +21 -18 lines
Diff to previous 1.50 (colored)

Add missing call to atexit() to clean up temp files on error.
Use mkstemp() to create the temp file when "sort -o" specifies
the same name as an input file and preserve the original file
mode on the temp file.  Check for write access on the original
file before creating the temporary.
Based on a diff from and OK bluhm@

Revision 1.50 / (download) - annotate - [select for diffs], Mon Mar 30 22:20:53 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Use _exit() from signal handler so we don't call atexit handlers or
flush stdio.

Revision 1.49 / (download) - annotate - [select for diffs], Mon Mar 30 22:20:18 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.48: +13 -41 lines
Diff to previous 1.48 (colored)

Do not install signal handlers for SIGABRT, SIGBUS or SIGSEGV.  Also
install signal handlers for SIGPIPE, SIGXCPU, SIGXFSZ, SIGVTALRM,
and SIGPROF to match the old sort.

Revision 1.48 / (download) - annotate - [select for diffs], Fri Mar 20 23:04:07 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.47: +27 -16 lines
Diff to previous 1.47 (colored)

Use the hw.usermem sysctl to determine the amount user (non-kernel)
memory instead of sysconf(_SC_PHYS_PAGES) (which also counts pages
wired by the kernel).  Don't try to use a memory buffer larger than
the datasize hard resource limit.  Adapted from a diff by Andre Smagin.

Revision 1.47 / (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.46: +29 -25 lines
Diff to previous 1.46 (colored)

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

Revision 1.46 / (download) - annotate - [select for diffs], Thu Mar 19 13:11:05 2015 UTC (9 years, 2 months ago) by jmc
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

update the note in STANDARDS about which options are extensions; also add -m
to SYNOPSIS and usage(), which i missed in previous;

Revision 1.45 / (download) - annotate - [select for diffs], Thu Mar 19 11:38:12 2015 UTC (9 years, 2 months ago) by jmc
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

first run through this page. mainly getting SYNOPSIS and usage() orderly
(if perhaps not quite correct yet);

Revision 1.44 / (download) - annotate - [select for diffs], Tue Mar 17 17:45:13 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.43: +1118 -273 lines
Diff to previous 1.43 (colored)

Initial import of FreeBSD sort.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Oct 26 05:10:29 2014 UTC (9 years, 6 months ago) by brad
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

Add parentheses to suppress compiler warning.

sort.c:295:35: warning: '&&' within '||' [-Wlogical-op-parentheses]

ok guenther@

Revision 1.42 / (download) - annotate - [select for diffs], Sat Oct 11 03:02:59 2014 UTC (9 years, 7 months ago) by doug
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored)

Userland reallocarray() audit.

Avoid potential integer overflow in the size argument of malloc() and
realloc() by using reallocarray() to avoid unchecked multiplication.

ok deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Wed Nov 13 15:07:27 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.40: +4 -3 lines
Diff to previous 1.40 (colored)

repair buffer resizing "undershoot", and some minor issues with
math on void *
assistance from guenther, ok millert

Revision 1.40 / (download) - annotate - [select for diffs], Tue Oct 30 20:03:16 2012 UTC (11 years, 6 months ago) by gsoares
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

fdopen(3) return a FILE * not an int, so compare against NULL.
no functional change

OK millert@

Revision 1.39 / (download) - annotate - [select for diffs], Tue Dec 22 19:47:02 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.38: +12 -6 lines
Diff to previous 1.38 (colored)

implement -C (silent -c), required by POSIX.1-2008;
patch from Daniel Dickman <didickman at gmail dot com> tweaked by me;
"looks ok" millert@, manual help and ok jmc@

Revision 1.38 / (download) - annotate - [select for diffs], Wed Oct 28 20:41:39 2009 UTC (14 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.37: +6 -3 lines
Diff to previous 1.37 (colored)

Don't catch a signal if we inherited it as ignored.  Instigated by
comments from Matt Fisher (mfisher_ix at maine.rr.com).

ok otto@

Revision 1.37 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:43 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.36: +1 -15 lines
Diff to previous 1.36 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.36 / (download) - annotate - [select for diffs], Wed Aug 22 06:56:40 2007 UTC (16 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored)

sort usage();

Revision 1.35 / (download) - annotate - [select for diffs], Tue Aug 21 20:29:25 2007 UTC (16 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.34: +8 -5 lines
Diff to previous 1.34 (colored)

Add a -s option to make the radix sort be a stable sort.  Based on
a diff from Eric Gouyer.  Closes PR 5553.  OK deraadt@

Revision 1.34 / (download) - annotate - [select for diffs], Tue Mar 13 17:33:58 2007 UTC (17 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.33: +3 -6 lines
Diff to previous 1.33 (colored)

Use separate buffers in fsort.c and msort.c.  Fixes a problem with
buffer corruptions for some very large files.  Also fixes some
TRECHEADER vs. RECHEADER mismatches.  Back in after unlock.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Mar 11 00:38:01 2007 UTC (17 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.32: +4 -1 lines
Diff to previous 1.32 (colored)

some bug (in sort?  or compiler) gets hit too late in the release cycle.
please try again right after release.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Mar 7 18:11:03 2007 UTC (17 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.31: +3 -6 lines
Diff to previous 1.31 (colored)

Use separate buffers in fsort.c and msort.c.  Fixes a problem with
buffer corruptions for some very large files.  Also fixes some
TRECHEADER vs. RECHEADER mismatches.  OK deraadt@ otto@ ray@

Revision 1.31 / (download) - annotate - [select for diffs], Sun Oct 29 18:40:34 2006 UTC (17 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.30: +8 -0 lines
Diff to previous 1.30 (colored)

Remove useless code that can cause a SEGV if a buffer is realloc()ed.
Allocate buffers early and in one place instead of two.
Make bufend global so it can be updated along with buffer.
OK deraadt@

Revision 1.30 / (download) - annotate - [select for diffs], Sat Oct 28 21:14:29 2006 UTC (17 years, 6 months ago) by naddy
Branch: MAIN
Changes since 1.29: +2 -9 lines
Diff to previous 1.29 (colored)

revert previous change; causes segfault when called from
pkg_mklocatedb/locate.mklocatedb

Revision 1.29 / (download) - annotate - [select for diffs], Wed Oct 18 23:30:43 2006 UTC (17 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.28: +9 -2 lines
Diff to previous 1.28 (colored)

Remove useless code that can cause a SEGV if a buffer is realloc()ed.
Allocate buffers early and in one place instead of two.
Fixes PR 5252; OK deraadt

Revision 1.28 / (download) - annotate - [select for diffs], Tue Oct 4 15:10:27 2005 UTC (18 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

remove ellipsis from -k in usage();

Revision 1.27 / (download) - annotate - [select for diffs], Wed Sep 28 10:10:16 2005 UTC (18 years, 7 months ago) by jmc
Branch: MAIN
Changes since 1.26: +5 -4 lines
Diff to previous 1.26 (colored)

sort options and sync usage();
some help from dlg@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Sep 27 23:40:07 2005 UTC (18 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.25: +11 -4 lines
Diff to previous 1.25 (colored)

add a -z option that allows you to split records on the nul character
('\0'). useful in combination with things like "find . -print0" and
"xargs -0". for dewi, a chump.

ok deraadt@

Revision 1.25 / (download) - annotate - [select for diffs], Mon Apr 11 21:04:48 2005 UTC (19 years, 1 month ago) by moritz
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.24: +3 -5 lines
Diff to previous 1.24 (colored)

remove silly optimization which should eventually save
a syscall, when it were not broken. ok otto@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Sep 14 22:57:21 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored)

ARGSUSED before signal handler with unused signo

Revision 1.23 / (download) - annotate - [select for diffs], Wed Mar 17 18:24:49 2004 UTC (20 years, 2 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.22: +2 -3 lines
Diff to previous 1.22 (colored)

do not init SINGL_FLD, SEP_FLAG twice; from robert nagy

Revision 1.22 / (download) - annotate - [select for diffs], Thu Jun 26 00:12:39 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

protos

Revision 1.21 / (download) - annotate - [select for diffs], Tue Jun 10 22:20:51 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +6 -10 lines
Diff to previous 1.20 (colored)

mostly ansi cleanup; pval ok

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:16 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.19: +3 -7 lines
Diff to previous 1.19 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Mar 30 23:11:41 2003 UTC (21 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

Use PATH_MAX, not _POSIX_PATH_MAX for filename buffers.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:52 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.17: +5 -5 lines
Diff to previous 1.17 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Nov 17 19:51:34 2001 UTC (22 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.16: +6 -4 lines
Diff to previous 1.16 (colored)

Repair brain-damaged struct sigaction initialization.
Noticed by Theo.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Feb 4 21:27:01 2001 UTC (23 years, 3 months ago) by ericj
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.15: +6 -3 lines
Diff to previous 1.15 (colored)


Bring in some recent fixup's from NetBSD. This allows lines longer than 65522
to be properly sorted. Many other cleanup's done, and depreciate register.
millert@ and deraadt@ ok.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jan 19 17:58:18 2001 UTC (23 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

mark remaining signal races which are difficult to fix, and fix a few partially

Revision 1.13.2.1 / (download) - annotate - [select for diffs], Fri Oct 6 21:16:17 2000 UTC (23 years, 7 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.13: +8 -8 lines
Diff to previous 1.13 (colored) next main 1.14 (colored)

Pull in patch from current (even more to come):
Fix (millert):
warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant).  These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jun 30 16:00:23 2000 UTC (23 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.13: +8 -8 lines
Diff to previous 1.13 (colored)

warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant).  These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).

Revision 1.13 / (download) - annotate - [select for diffs], Tue Nov 30 16:41:41 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE
Branch point for: OPENBSD_2_7
Changes since 1.12: +11 -3 lines
Diff to previous 1.12 (colored)

Using mkstemp to create permanent files is possible, but then
the file mode needs tweaking to look like normal file creation.

Approved by millert@, noticed by my students at Epita. Thanks guys !

Revision 1.12 / (download) - annotate - [select for diffs], Mon May 24 17:57:19 1999 UTC (25 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.11: +21 -9 lines
Diff to previous 1.11 (colored)

Dynamically allocate memory for structures whose sizes are based on the
number of keys given.  Closes PR #825.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jul 24 00:32:24 1998 UTC (25 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

put -H in synopsis; aaron@ug.cs.dal.ca

Revision 1.10 / (download) - annotate - [select for diffs], Mon Jul 20 20:02:19 1998 UTC (25 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.9: +4 -3 lines
Diff to previous 1.9 (colored)

use warnx()

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jul 20 19:49:32 1998 UTC (25 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

indent

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jul 20 19:46:15 1998 UTC (25 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +7 -5 lines
Diff to previous 1.7 (colored)

fix usage correctly

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jul 20 19:14:37 1998 UTC (25 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.6: +4 -4 lines
Diff to previous 1.6 (colored)

consolidate printfs

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jun 30 05:36:18 1997 UTC (26 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

64bit fixes.  Some of these are a bit bogus as there were "long"s
meant to be file offsets for fseek(3).  However, those values
could never be > an int anyay so it is not a problem.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 16 02:39:15 1997 UTC (26 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.4: +5 -11 lines
Diff to previous 1.4 (colored)

Normalize treatment of -n option.  Don't know why it was ever special-cased
(since it was broken that way).  Fixes PR user/220.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jun 16 02:21:56 1997 UTC (26 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.3: +28 -9 lines
Diff to previous 1.3 (colored)

Cosmetic cleanup, mostly KNF.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 26 00:02:25 1997 UTC (27 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.2: +11 -5 lines
Diff to previous 1.2 (colored)

for implied stdin, do not corrupt argv[0]

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jan 22 06:53:16 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.1: +7 -7 lines
Diff to previous 1.1 (colored)

Fix some err(3) usage and usage string.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jan 20 19:39:55 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN

sort(1) from 4.4BSD-lite2 with minor tweaks and bug fixes by me.

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.