1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

51 Commits

Author SHA1 Message Date
cheloha
d7259957e8 userspace: remove vestigial '?' cases from top-level getopt(3) loops
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2

ok naddy@ millert@ dlg@
2022-12-04 23:50:45 +00:00
martijn
2c40dbd143 getline(3) does it's own memory allocation. No need to use an intermediate
buffer and copy it over to the final destination.

Tweaks and OK millert@, schwarze@
2020-07-23 20:13:01 +00:00
martijn
6f360e4067 Remove slurpit definition. Leftover from earlier cleanup by otto@. 2018-11-14 15:16:09 +00:00
martijn
a357bf34de Allow join(1) to join on a multibyte separator.
small nit and OK otto@
2018-11-06 13:51:28 +00:00
martijn
502fc326ab Allow us to join on NULL columns. This is similar to what the other
implementations do and new behaviour was most likely added by accident
in r1.4.

OK otto@
2018-10-23 08:41:45 +00:00
otto
961fa3fca9 Fix wrong result on full and outer join, bringer us closer to
the FreeBSD version. The fseek/fpos changes introduced by the 1.4 commit were
not part of bsd44lite and are not needed to fix the bug. ok martijn@
2018-10-18 09:36:48 +00:00
millert
5a81dcea78 Convert from fgetln(3) to getline(3). Based on a diff from Lauri Tirkkonen.
With a tweak and OK from schwarze@
2018-07-18 17:20:54 +00:00
deraadt
0bd1216cbf Change all tame callers to namechange to pledge(2). 2015-10-09 01:37:06 +00:00
deraadt
37214e4c31 tame "stdio rpath" at the start, then potentially some files are opened.
After that, tame "stdio" because that's all this program does.
2015-10-07 04:00:45 +00:00
jasper
5340d3e807 zap trailing whitespace 2015-07-21 04:42:59 +00:00
deraadt
b9fc9a728f Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
2015-01-16 06:39:28 +00:00
doug
3c12eecb8a Userland reallocarray() audit.
Avoid potential integer overflow in the size argument of malloc() and
realloc() by using reallocarray() to avoid unchecked multiplication.

ok deraadt@
2014-10-11 04:31:55 +00:00
schwarze
940794c79a Fix .Ar macro abuse; found with mandocdb(8). 2014-01-19 23:56:06 +00:00
millert
8929f197a7 Include unistd.h as it is the standard location for getopt(). 2013-11-15 22:20:04 +00:00
jmc
f1c64ac4de add an EXIT STATUS section for /usr/bin; 2010-09-03 11:09:28 +00:00
deraadt
043fbe51c1 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
2009-10-27 23:59:19 +00:00
jmc
99332e389a bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a few
updates to follow;
2009-02-08 17:15:08 +00:00
jmc
9490d37cb6 convert to new .Dd format; 2007-05-31 19:19:00 +00:00
jmc
7c5a075bb3 - use a consistent text for STANDARDS
- note which options are extensions to POSIX
2007-05-30 04:41:33 +00:00
jmc
a9b83724e4 remove -j from SYNOPSIS and usage(); it's deprecated and already
documented in STANDARDS;

ok otto
2007-05-29 18:29:26 +00:00
millert
2455d05ac4 Remove duplicate commment
Simplify -j parsing
Use warnx() not errx() for illegal -j option so that usage() gets called.
When parsing -o don't go past the end of argv
Sync usage() with man page, use __progname and make it line up nicely
Based on a diff from Tobias Stoeckmann
2007-04-23 19:21:24 +00:00
jmc
e8b5f1bc1c - rearrange text
- sort options
- some markup fixes
2006-12-28 11:27:41 +00:00
hugh
123c77e890 Spread some .Xr for the hard to stumble across lam(1).
jmc yeps.
2006-05-02 05:21:41 +00:00
otto
2ccfb32c3f Follow Posix when writing non-matching lines. Historically, join(1)
did not change the order of fields of non-matching lines if no -o
option was used, but -a or -v was specified.  This update writes
the join field first, followed by the remaining fields of a
non-matching line.

This change breaks the old security(8), so don't forget to update
/etc/security. From PR 2208. Testing and man page help and ok by jmc@

ok millert@ deraadt@
2003-12-28 19:53:23 +00:00
otto
d697e2c491 Update, mostly from FreeBSD:
o Realloc cleanup.
o Some long vs int cleanup.
o Implement the Posix defined 0 as -o field value, meaning the join field.
o Allow both -a 1 and -a1, and warn if the backward compatibility "-a without
  a number" is used.

ok millert@ deraadt@
2003-12-12 10:38:44 +00:00
deraadt
1837a5ca50 mostly ansi cleanup; pval ok 2003-06-10 22:20:44 +00:00
jmc
2aeff9fb4d - section reorder
- COMPATIBILITY merge
- macro cleanup
- kill whitespace at EOL
- new sentence, new line

ssh pages ok markus@
2003-06-10 09:12:09 +00:00
millert
f75387cb26 Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.
2003-06-03 02:56:05 +00:00
millert
c72b5b24e1 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. 2002-02-16 21:27:05 +00:00
niklas
d4e7c60304 $OpenBSD$ 2001-01-29 01:57:55 +00:00
aaron
3746a81674 - Section shuffling: comply to the section ordering outlined in mdoc(7).
- Some .Nm trimming.
- .Sh AUTHOR -> .Sh AUTHORS
- Other miscellaneous fixes here and there.
2000-11-10 05:10:21 +00:00
aaron
f1ba34738e Change all option list specifications to ".Bl -tag -width Ds". Most man
pages just needed their -width parameter tweaked to "Ds", which provides
a nice width of 6 constant characters. For consistency more than anything.
2000-11-09 17:51:53 +00:00
aaron
2e3943820e Various cleanups and improvements. 2000-03-08 03:11:27 +00:00
aaron
8cf461a5aa Finish standardizing options list introduction. 2000-03-05 00:28:49 +00:00
aaron
3f78588eda In Unix land we prefer "whitespace" to "white space" or "white-space". At
least, this is the impression I get from looking at a lot of Perl docs.
2000-03-04 22:19:22 +00:00
aaron
ff2a54b721 fieldcnt is the number of fields, not +1... this one was missed in 1995
when the other two were fixed
1999-07-23 23:37:34 +00:00
aaron
581190f2b8 correct use of .Nm; some other formatting nits 1999-07-04 11:53:50 +00:00
deraadt
2ed5cd9005 more -Wall 1998-11-16 06:09:12 +00:00
aaron
aea1524a59 usr.bin/ man page fixes, f-m. 1998-09-26 19:54:41 +00:00
deraadt
7a1f6f439f require compat opts start with -; bug from kh@mogami-wire.co.jp; fix from freebsd 1997-08-25 05:31:10 +00:00
deraadt
b5b791dfef argh 1997-07-24 01:35:30 +00:00
deraadt
c5e6c45640 arg parsing bug in compat code; kh@mogami-wire.co.jp 1997-07-23 02:59:33 +00:00
michaels
6eced1a1a4 just clean up a stylistic mess I created myself long ago. 1997-04-09 16:42:25 +00:00
millert
72799b18e5 getopt(3) returns -1 when out of args, not EOF, whee! 1997-01-15 23:40:20 +00:00
millert
521d73aa3c Clarification. From NetBSD. 1997-01-15 00:01:22 +00:00
michaels
b472c5f50a remove dead code, add comments, put back original comments (Cthulu
may know how they were lost).
1996-08-12 16:37:00 +00:00
michaels
57441abb64 "the remaining fields" -> "the other fields" 1996-08-12 02:32:32 +00:00
michaels
38273b34d0 on Theo's suggestion replaced join with join from 44lite, fixed (?)
netbsd pr #1356 (reported by mouse@Collatz.McRCIM.McGill.EDU, der Mouse)
1996-08-12 02:31:53 +00:00
deraadt
1258a77d10 rcsid 1996-06-26 05:31:08 +00:00
deraadt
73a4f38905 fieldcnt is number of fields, not +1; from mouse@Collatz.McRCIM.McGill.EDU; netbsd pr#1356 1995-12-22 19:02:55 +00:00