Commit Graph

14120 Commits

Author SHA1 Message Date
rillig
e4b4cc0e9c Add another unit test for the :M modifier 2019-11-30 02:31:19 +00:00
rillig
5ed433bfe1 Add unit tests for variable modifiers like :M and :N 2019-11-30 00:38:51 +00:00
sevan
09b8c16ba2 Add Aaron Swartz and Steve Jobs 2019-11-28 23:49:13 +00:00
martin
7c9e4fdc5a msg_table_add(): fix mishap in the format safety changes in r1.45 2019-11-16 17:38:09 +00:00
wiz
5b72b9d868 Remove list of audio drivers, moved to audio(4). 2019-11-12 12:50:30 +00:00
joerg
76c7fc5f6b Update LLVM to 10.0.0git (01f3a59fb3e2542fce74c768718f594d0debd0da) 2019-11-11 22:44:56 +00:00
joerg
856452fc2a Spell the largest 32bit signed value as INT32_MAX. Explicitly cast to
float, because it is not precisely representable.
2019-11-11 15:40:42 +00:00
wiz
899b15813c Fix a typo. Fix some xrefs, comment out references to non-existing man pages. 2019-11-11 11:04:15 +00:00
christos
dbeaf00305 Understand _Alignof 2019-11-09 19:54:09 +00:00
mrg
e130416089 copyright maint. 2019-11-09 12:54:34 +00:00
mrg
95676db785 add support for playing IEEE float32 and float64 RIFF WAVE
samples on platforms that have these types natively, and
can handle signed linear 32 bit samples.  explicitly
disabled on vax, run-or-compile-time sizeof() check
disabled for everyone else

now i can play a float32 .wav file i found.
float64 not tested.

copyright maint, update HISTORY, update audio drivers list.
2019-11-09 12:46:44 +00:00
pgoyette
2f690417ed Belatedly update several entries that move from year to year. 2019-11-06 13:46:04 +00:00
joerg
a0e0f8b685 PR 54093: Align static TLS area to max_align_t. 2019-11-04 12:45:10 +00:00
kamil
77a1ad5f00 Switch the iconv(3) prototype to the POSIX conformant variation
Remove const from the 2nd argument.

const char ** and char ** are incompatible types and it was a cost to keep
the technically incompatible form for a more purist variation. NetBSD was
almost the last alive OS to still keep the const argument (known leftovers:
Minix and Illumos).

Keep the const form for the internal purposes inside citrus and rump.

Address the build breakage fallout in the same change.

There are no ABI changes.

Change accepted by core@.
2019-10-24 18:17:14 +00:00
jhigh
b302373f87 adding argon2 support to libcrypt. argon2 user authentication now
available via MKARGON2=yes (3 variants supported; argon2id recommended)
before using, please read argon2 paper at
https://github.com/P-H-C/phc-winner-argon2
2019-10-21 02:36:48 +00:00
christos
8451d1ca24 use stdarg, annotate function as __printflike and fix broken formats. 2019-10-19 15:44:31 +00:00
sevan
c8c96838bd Add Ted Nelson's birthday 2019-10-14 17:30:17 +00:00
christos
7043e4b635 use strlcpy instead of strncpy. 2019-10-13 21:12:32 +00:00
christos
d3062ef0ff can't happen, but gcc can't figure it out. 2019-10-13 20:43:25 +00:00
christos
d24a806584 fool gcc with strncpy. 2019-10-13 19:39:15 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
christos
706110a226 avoid strcpy. 2019-10-12 17:50:56 +00:00
sevan
64523049ba Add SICP
https://twitter.com/mit_csail/status/1164226910035087360
2019-10-06 19:53:04 +00:00
mrg
4df8bc966e sprintf() -> snprintf(), and adjust a buffer size to avoid any
potential for overflow.
2019-10-06 00:27:50 +00:00
mrg
cfe79b5b48 use memcpy() for strings that are not C strings.
destinations are already sufficiently sized and nul terminated.
2019-10-05 23:35:57 +00:00
christos
bdf26a6120 Recognize \oOOO \dDD \xXX plus the other regular 'C' backslash escapes like
gnu sed does, except when inside regex []. (Gnu sed translates those too,
unless --posix is specified).
2019-10-05 20:23:55 +00:00
christos
3379dd2438 add an abort for a case that can't happen 2019-10-05 20:22:36 +00:00
mrg
03c86659de fix a bug gcc 8 picked up: use ~LOCK_NB to look for LOCK_UN,
like the rest of the code does.

from uwe@.
2019-10-04 16:27:00 +00:00
uwe
5e58365557 Undo the confusion. Use separate synopsis lines for -c command with
single argument (sh -c) and command [args ...] forms.
2019-10-04 16:14:05 +00:00
uwe
371c573fa8 The command is not optional. 2019-10-04 15:30:16 +00:00
uwe
612f4075e0 Tweak formatting. 2019-10-04 11:49:48 +00:00
mrg
0576183ec8 revert previous; i meant to test first and if you read the comment
immediately above, you can see it is done safely and on purpose.
2019-10-04 11:43:07 +00:00
mrg
f97b85d675 use destination buffer size not source buffer size for strncpy len. 2019-10-04 11:40:43 +00:00
mrg
0af6a5291a use memmove() instead of strncpy() for overlapping strings.
ensure nul termination.
2019-10-04 11:39:44 +00:00
mrg
80df6cf66d adjust fallthru comment. 2019-10-04 11:12:16 +00:00
mrg
628b66af12 turn off various warnings for various things:
- file has looks bogus maybe-uninitialized
- llvm triggers an attribute violation:
  ScheduleDAGInstrs.cpp:1430:14: error: declaration of
    'llvm::raw_ostream& llvm::operator<<(llvm::raw_ostream&, const llvm::ILPValue&)'
    with attribute 'noinline' follows inline declaration [-Werror=attributes]
- ntp and pkg_install have obvious restrict violations, should be
  fixed but i'm avoiding patching upstream code in this pass
- tftp has an array bounds that doesn't seem real issue
- sysinst's partman.c has major problem with passing the same
  string as source and dest in snprintf, as a way to strcat
  with formatting which trip restrict violations.  non trivial
  to fix so for now the warning is elided.
- Xext's XEVI.c has similar issue as partman.c

everyone and GCC 8 gets these warnings turned off for now:

	-Wno-format-truncation
	-Wno-stringop-overflow
	-Wno-stringop-truncation
	-Wno-cast-function-type

as they trip a large amount of code.  most of them should be
investigated, but the few i looked at were not finding actually
real bugs, vs instances of poor coding, so skipping for now.
2019-10-04 09:47:27 +00:00
mrg
a83f6c1317 msg:
avoid passing the same pointer in multiple arguments for restrict
marked arguments:
- sigaction() wants separate in/out
- use memmove() not memcpy() for overlapping regions (this may fix
  a real bug in nvi -- but it seems unlikely)
- select() wants separate read/write/except
- sigprocmask() wants separate set/oset
2019-10-04 09:01:59 +00:00
sevan
df68535e27 Skip options which rely on crypto support in getopt() argument list, if we're
not building with cryto support.

via JP <rlntlss83 at gmail com> on tech-misc@
2019-10-03 01:15:19 +00:00
sevan
39ad3db35e Add Alan Perlis 2019-10-01 17:58:25 +00:00
mrg
21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
sjg
7d130808c7 Do not assume safe to pass NULL to realpath(3).
PR: 54574
Reviewed by: buhrow
2019-09-26 21:09:55 +00:00
christos
02cdd248ec Add a new member to struct vfsstat and grow the unused members
The new member is caled f_mntfromlabel and it is the dkw_wname
of the corresponding wedge. This is now used by df -W to display
the mountpoint name as NAME=
2019-09-22 22:59:37 +00:00
dsainty
8c74e515a9 Purge an ancient email address, use dsainty@NetBSD.org instead 2019-09-22 07:28:35 +00:00
sevan
0ed1b2a1a6 We use spaces, not tabs here 2019-09-21 09:23:11 +00:00
sevan
88d1988908 sort 2019-09-21 09:15:24 +00:00
sevan
eaa5be79ae Add 8.1 release 2019-09-21 09:13:10 +00:00
dyoung
edd6d16024 Deduplicate some code I'd duplicated, shorten a couple of staircases,
repair the indentation in usage().  NFCI.
2019-09-13 17:32:29 +00:00
dyoung
733dd361b1 Fix unexpand -a -t n, which also did not treat -t n like it
established stops n, 2 n, 3 n, ....
2019-09-13 17:26:27 +00:00
dyoung
5487d3395a Fix a handful of bugs in unexpand(1):
1. -a and -t were mutually exclusive when they should not be.

2. `unexpand -t n` did not treat a file like there were stops at n, 2
   n, 3 n, 4 n, and so on.  So expanded tabs after column 4 were not
   collapsed.

3. a debug fprintf wrote every tabstop set with `-t` to the standard
   error stream.

TBD write some tests.
2019-09-13 16:53:05 +00:00
christos
d275294e40 Expose struct namecache. 2019-09-13 13:56:04 +00:00
christos
c2ff892ce4 deal with variable length namecache entries. 2019-09-13 13:55:24 +00:00
wiz
2555b24764 Use \(em. 2019-09-06 19:05:04 +00:00
christos
ebe962e4c8 Add -O to print offsets; align columns properly. 2019-09-06 17:08:22 +00:00
christos
3876b93077 Fix decorators for __thread, add _Thread_local
christos
2019-09-05 20:12:11 +00:00
wiz
f592f951d4 Remove superfluous Ns. 2019-09-01 19:12:16 +00:00
wiz
3e49c49077 Remove superfluous Pp. 2019-09-01 19:10:39 +00:00
sevan
6eaac38858 write was in v1
https://www.bell-labs.com/usr/dmr/www/man14.pdf
2019-09-01 18:48:01 +00:00
sevan
9e5ce6cda6 Update URL 2019-09-01 18:46:22 +00:00
sevan
ddac411ea4 Document history
https://www.bell-labs.com/usr/dmr/www/man14.pdf
2019-09-01 18:44:06 +00:00
sevan
17e867a69e Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf
2019-09-01 18:41:14 +00:00
sevan
a4ee5060f0 su was in v1
https://www.bell-labs.com/usr/dmr/www/man13.pdf
2019-09-01 18:37:44 +00:00
sevan
450d651e78 Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf
2019-09-01 18:31:37 +00:00
sevan
a77b177db2 mesg was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:26:01 +00:00
sevan
822dbc9721 mail was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:24:28 +00:00
sevan
01835ef10c du was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:18:42 +00:00
sevan
84c091c750 dc was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:15:57 +00:00
sevan
b80ec07d43 sort was there since v1
https://www.bell-labs.com/usr/dmr/www/man61.pdf
2019-09-01 18:04:54 +00:00
isaki
3dbad28612 Revert about index number changes. It breaks its usage and output format.
Pointed out by mrg@.
2019-08-24 07:39:42 +00:00
isaki
52ec5b0764 Create a waveform in hardware native sample rate which is more efficient. 2019-08-24 06:32:25 +00:00
isaki
0c69e485a6 AUDIO_GETBUFINFO is more efficient for this purpose. 2019-08-24 06:16:27 +00:00
isaki
04ea388fd4 Fix markup. index of list command is optional. 2019-08-24 06:13:01 +00:00
isaki
8452326aba Make the same code that appears repeatedly a function. 2019-08-24 06:11:10 +00:00
isaki
16e140802c Use err(3)/warn(3) instead of perror(3)/fprintf(stderr,...).
Use getprogname(3) for usage().
2019-08-24 06:00:49 +00:00
isaki
2116fa4f0a Check mode argument earlier. 2019-08-24 05:51:06 +00:00
isaki
cb1e8d26ed Use device unit number for index.
The index number was too confusing such as
 0: [ ] audio1 @ wss0
 1: [*] audio0 @ yds0
in my PC for example.  Here is new format:
 [*] audio0 @ yds0
 [ ] audio1 @ wss0
In this style, devices are always listed in order of unit number
and 0 always means audio0, 1 always means audio1.
2019-08-24 05:45:24 +00:00
isaki
ab49aa4fd6 Revert to use single descriptor for "audiocfg test" as before. 2019-08-24 04:04:10 +00:00
isaki
923f5af2bd Rename some members in adev for clarity. No functional changes intended. 2019-08-24 03:28:37 +00:00
sevan
f918268338 Add Danny Cohen
https://www.nytimes.com/2019/08/16/obituaries/danny-cohen-who-helped-set-the-stage-for-a-digital-era-dies-at-81.html
2019-08-23 11:09:14 +00:00
isaki
5e4788ee0a Fix assertion of "audiocfg list <n>" when n is an illegal index. 2019-08-22 14:40:14 +00:00
christos
8603a9eb39 check speed argument conversion (Thierry Laronde) 2019-08-18 14:16:02 +00:00
kamil
fc2fae23cf netstat: Add indirection of symbols to remove clash with sanitizers
Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname, sysctlgetmibinfo and sysctlnametomib.
2019-08-18 04:14:40 +00:00
kamil
774dcce2f6 sockstat: Add indirection of symbols to remove clash with sanitizers
Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlgetmibinfo and sysctlnametomib.
2019-08-18 04:13:24 +00:00
joerg
fb6d0a4e0d Explicitly link against libpthread and liblzma to make static linking
happy. Newer libarchive supports LZMA compression in zip files.
2019-07-28 12:44:36 +00:00
christos
1a0087198a PR/54410: fmoon: typos in mail(1) 2019-07-26 13:05:30 +00:00
sevan
f6d2123b3a Add bicycle day 2019-07-23 18:28:59 +00:00
nonaka
889dcccd73 kdump(1): Symbolic printing for MALLOC_OPTIONS="U". 2019-07-23 01:54:51 +00:00
kre
8ad10c91e9 Amend the previous change: we can have (almost) the best of both
worlds, as when the first arg (which should be the format) contains
no % conversions, and there are more args, the results are unspecified
(according to POSIX).

We can use this so the previous usage
	printf -- format arg...
(which is stupid, and pointless, but used to work) continues to
simply ignore the -- (unspecified results mean we can do whatever
feels good...)

This brings back the #if 0'd block from the previous modification
(so there is no longer anything that needs cleaning up later) but runs
the getopt() loop it contained only when there are at least 2 args
(so any 1 arg printf always uses that arg as the format string,
whatever it contains, including just "--") and also only when the
first (format) arg contains no '%' characters (which guarantees no %
conversions without needing to actually parse the arg).  This is the
(or a) "unspecified results" case from POSIX, so we are free to do
anything we like - including assuming that we might have options
(we don't) and pretending to process them.
2019-07-22 17:34:31 +00:00
kre
b6a771f35e Stop assuming that printf handles options in any way at all
(it doesn't - that is, shouldn't) which includes processing -- as an
"end of options".  The first arg is (always) the format string.

Remove call to getopt() (but still do associated changes to argc/argv)

Note: for now this is #if 0's out instead of being deleted, the old
code should be fully removed sometime soon.

Problem pointed out on tech-userlevel by Thierry Laronde.
2019-07-21 15:25:39 +00:00
sevan
b60ae75e99 Add Fernando Jose Corbato
https://multicians.org/corby.html
https://www.nytimes.com/2019/07/12/science/fernando-corbato-dead.html
2019-07-14 10:43:01 +00:00
christos
a713a1068c allow c9x struct casts (in new libXt) 2019-07-12 23:32:45 +00:00
msaitoh
03e9d50adf Fix typo (s/supress/suppress/). 2019-07-11 03:49:51 +00:00
he
feecb28e70 Make the scaling of the "bytes written" sticky, so that if we go
to K, we don't return to unscaled, and similar for higher scales
(though it takes some effort, due to the wide field...)
Fixes PR#54334.
2019-06-30 19:57:23 +00:00
sevan
a8ded70395 Add John von Neumann's date of death 2019-06-30 11:21:40 +00:00
joerg
85722e51b9 Do the fmtcheck for both message lookups to satisfy format string
literal checks.
2019-06-25 21:09:33 +00:00
martin
787f237e5b Limit maximum owner name to appease gcc 2019-06-25 14:52:55 +00:00
christos
c9e3ec3ad5 Use OPT_NOMENU instead of -1 2019-06-23 22:48:15 +00:00
christos
7743b1bf0c use calloc properly. 2019-06-23 22:47:22 +00:00
christos
48d8b2ae49 don't cast malloc. 2019-06-23 22:46:53 +00:00
christos
e2deb0a92c define as hex and make MC_VALID smaller so it fits in a short. 2019-06-23 22:46:41 +00:00
martin
d8297eb873 Menu 0 does not exist anymore (it is now OPT_NOMENU), so emit an empty
menu defintion for it.
2019-06-23 11:31:10 +00:00
martin
5908298eb7 Use OPT_NOMENU as error return for new_menu (instead of old hard coded -1).
Update man page for the OPT_NOMENU change.
2019-06-23 11:22:48 +00:00
christos
4a69030bcd trim down error checking if we are small. 2019-06-22 23:40:53 +00:00
christos
9bedb72e28 make this compile again with -DNO_PROGRESS 2019-06-22 23:40:33 +00:00
christos
4cd30f5b0c Conserve space: make ints to shorts and make OPT_NOMENU 0 instead of -1
so we don't require initializing it.
2019-06-22 20:44:54 +00:00
martin
ec547ea245 Re-add msg_clear() accidently dropped in previous. 2019-06-20 11:31:12 +00:00
christos
0e1db64433 Introduce _fmt_ flavors of the menu functions that take a formatting string
so we can use fmtcheck(3) to check the formats of the messages strings.
2019-06-20 00:45:18 +00:00
sevan
a46fcec08e Happy 32nd birthday SDF.org!
https://twitter.com/sdf_pubnix/status/1140280083598327810
https://sdf.org/?faq?BASICS?02
2019-06-18 12:05:51 +00:00
kre
9c62ddd5c1 Deal with fallout from the addition of
KERN_PROC_CWD in sysctl(3)
That is kern.proc.$$.KERN_PROC_CWD (I think - not that it matters here)

The effect is that -lrump now requires -lrumpvfs

This set of changes fixes (I believe) regular dynamic builds,
more might be required for static builds (will be verified soon).
2019-06-01 06:59:17 +00:00
gutteridge
b6bb9bdde9 tr.1: add a "see also" xref to ctype(3) (to align with an inline
reference), improve punctuation, etc.

XXX lines 177-191 have been commented out since they were imported in
r. 1.2 back in 1993, they should probably be re-examined, and revised
or removed.
2019-05-29 11:27:34 +00:00
wiz
4c02e23096 Sort options in usage. 2019-05-19 09:14:13 +00:00
christos
59e8d36e8f - add flag to produce OMAGIC
- factor out complicated inline code into simpler functions
- add options parsing
2019-05-18 21:16:12 +00:00
ozaki-r
e28ae3abe7 Show the number of packets dropped by pfil 2019-05-13 07:48:42 +00:00
wiz
f96f071847 Sort options (no-argument options before ones demanding arguments).
Bump date.
2019-05-09 09:37:11 +00:00
wiz
adb7f5e61d Improve wording, bump date. 2019-05-09 09:34:58 +00:00
mrg
e288c0bcc9 when dumping a kernhist history replace "%s" with "%p" so that the
kernhist in kernel can be a little more usable without making the
userland dumping code crash.
2019-05-09 08:01:07 +00:00
isaki
017c116c97 Remove -p option. AUDIO_SETCHAN is insecure and is obsoleted. 2019-05-08 14:44:42 +00:00
isaki
0b88ff9914 Update respond to isaki-audio2 branch.
- Extend list command to display supported hardware formats.
- Add set command to set hardware format.
- Use correct /dev/audioctl instead of /dev/audio.
2019-05-08 14:36:12 +00:00
christos
41bb817512 You don't have to be _LP64 to run 32 bit binaries. You can be mips (64 bit
kernel/32 bit userland).
2019-05-06 19:20:13 +00:00
kamil
453514a280 Add support for SIGRTMIN+1..SIGRTMAX-1 signals in ktruss(1)
Generate misc.c and misc.h with entries for signals between SIGRTMIN+1
and SIGRTMAX-1.
2019-05-06 11:58:37 +00:00
wiz
c1260514c9 Sort SEE ALSO. 2019-05-06 06:56:07 +00:00
pgoyette
b4153cd6d8 Also fix the error message when -T is used with something other than A or D 2019-05-05 23:08:37 +00:00
pgoyette
dfa417c95a Fix the BUGS section. There is no `-t A'' or -t D'' option `-t''
requires an interval specification.  The correct bug info is for the
``-T A'' and ``-T D'' options.
2019-05-05 23:05:03 +00:00
isaki
fd2a21e429 Use err(3)/errx(3) properly to avoid "write failed: Undefined error: 0". 2019-05-04 08:27:30 +00:00
simonb
e348c98d9c Use PRWORD for printing -m/-mW totals so fields don't run in to each other.
While here, update field widths for 'vmstat -mW' for modern machines.
2019-04-30 23:29:18 +00:00
skrll
4402b4d24a Fix build on ppc64 2019-04-27 15:43:09 +00:00
skrll
6e604a1916 A couple of fixes so that NetBSD/cats builds (on linux), works, and
produces a symbol table that is readable (by 4.4BSD nm(1) at least)

- Change from OMAGIC to ZMAGIC
- Resize the a.out string table if we run out of space.
- output symbol table size as int32_t (the code already assumes no 64bit
  a.out.
2019-04-26 07:35:21 +00:00
christos
364bef3971 remove unused label 2019-04-23 17:35:10 +00:00
uwe
f14670a1d6 Don't pass '-' to getopt(3). My guess is that *very* old getopt
didn't handle "--" terminator, so this code was working around it and
not quite correctly at that.

Fixes weird output from

  $ uniq --long-option
  uniq: uniq: No such file or directory

(for more fun, run that command from /usr/bin as root).

Pointed out by Andreas Krey.
2019-04-23 14:40:12 +00:00
christos
af2b31c5c0 Undefine SSE stuff; we don't want portable code to depend on it and we
don't provide the necessary headers.
2019-04-13 15:08:49 +00:00
martin
e8ac518b01 Backout previous - our pool is zeroed, no need to reinitializ here. 2019-04-12 15:59:34 +00:00
martin
44df961cb4 new_menu: add missing initializations - we might be using a previously
freed menu entry which has not been zeroed.
2019-04-12 15:47:41 +00:00
sjg
bda55a25a3 ParseDoDependency: free paths rather than assert
PR: 52737
Reviewed by: christos
2019-04-09 18:28:10 +00:00
christos
e35c1a2b0b redo the connection waiting handling to make it more clear. 2019-04-07 00:44:54 +00:00
christos
2a5b01fca8 Fix asan heap buffer overflow. from enh at google. 2019-04-05 13:34:41 +00:00
wiz
95f5209749 New sentence, new line. Whitespace fixes. 2019-04-04 22:02:06 +00:00
kamil
b844317c23 FreeBSD indent r340138 2019-04-04 20:39:17 +00:00
kamil
d845d12b1a Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot
into our local copy.

FreeBSD actively maintains this program in their sources and their
repository contains over 100 commits with changes.

Keep the delta between the FreeBSD and NetBSD versions to absolute
minimum, mostly RCS Id and compatiblity fixes.

Major chages in this import:

 - Added an option -ldi<N> to control indentation of local variable names.
 - Added option -P for loading user-provided files as profiles
 - Added -tsn for setting tabsize
 - Rename -nsac/-sac ("space after cast") to -ncs/-cs
 - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines.
 - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
 - Group global option variables into an options structure
 - Use bsearch() for looking up type keywords.
 - Don't produce unneeded space character in function declarators
 - Don't unnecessarily add a blank before a comment ends.
 - Don't ignore newlines after comments that follow braces.

Merge the FreeBSD intend(1) tests with our ATF framework.
All tests pass.

Upgrade prepared by Manikishan Ghantasala.
Final polishing by myself.

Part II, checkin new files.
2019-04-04 15:27:35 +00:00
kamil
d6a1bc3f07 Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot
into our local copy.

FreeBSD actively maintains this program in their sources and their
repository contains over 100 commits with changes.

Keep the delta between the FreeBSD and NetBSD versions to absolute
minimum, mostly RCS Id and compatiblity fixes.

Major chages in this import:

 - Added an option -ldi<N> to control indentation of local variable names.
 - Added option -P for loading user-provided files as profiles
 - Added -tsn for setting tabsize
 - Rename -nsac/-sac ("space after cast") to -ncs/-cs
 - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines.
 - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
 - Group global option variables into an options structure
 - Use bsearch() for looking up type keywords.
 - Don't produce unneeded space character in function declarators
 - Don't unnecessarily add a blank before a comment ends.
 - Don't ignore newlines after comments that follow braces.

Merge the FreeBSD intend(1) tests with our ATF framework.
All tests pass.

Upgrade prepared by Manikishan Ghantasala.
Final polishing by myself.
2019-04-04 15:22:13 +00:00
christos
a5b9754eb4 Make fetch_read() return size_t like fread() does. It is bogus to
have one backing implementation that returns different values and
types than the other.  Handle error setting properly; i.e. bail
out if the internal read returned an error. Now we get a proper
error message when the the server resets our connection instead of
a warning that the right failed with an invalid argument.

The server used for testing was:
	http://capeweather.dyndns.org:8080/graphs/3474.png
Which seems to be unreliable :-)
2019-04-04 00:36:09 +00:00
kre
67d9f38e0b Use correct printf format for (struct input_file *)->lineno
SHould unbreak 32 bit host builds.
2019-03-26 23:31:45 +00:00
christos
26bb5ab43c fix use-after-free issue. 2019-03-26 16:41:06 +00:00
christos
5eea377e88 print the source line and file where the error happened. 2019-03-26 16:39:50 +00:00
christos
82af0135c7 Behave like gnu m4; when the error output file cannot be opened, just warn
and keep going.
2019-03-26 15:00:34 +00:00
maxv
ba0aa175c4 Remove compat_osf1, discussed on tech-kern@. 2019-03-25 19:24:29 +00:00
christos
24c1376449 no -g 2019-03-09 16:18:37 +00:00
christos
36c6018433 Fix another bug found by jemalloc: don't access dirent entry after closedir(3). 2019-03-09 16:18:22 +00:00
msaitoh
c2f2b1bf58 s/ the the / the / 2019-03-08 08:12:39 +00:00
christos
8238435d7e Add __thread/tls_model attribute 2019-03-04 17:45:16 +00:00
christos
8504f123fd add a two argument version of alloc_size 2019-03-04 15:28:18 +00:00
christos
54f8cd1eb6 add gnu_printf 2019-03-04 15:26:18 +00:00
rin
270ad452f4 When input is not a multiple of three bytes in size, pad null
characters instead of garbage. This makes output reproducible.

Taken from FreeBSD:
https://svnweb.freebsd.org/base?view=revision&revision=84715

Even though this is not demanded by POSIX, uuencode(1) in
FreeBSD, OpenBSD, macOS, and GNU, behaves that way.
2019-03-04 05:37:08 +00:00
christos
0c4ae0a48a Add more gnu attributes 2019-03-03 23:06:08 +00:00
martin
f239a04691 msg_prompt_win: allow automatic window height calculation (by passing
height = -1).
2019-03-01 17:02:21 +00:00
gson
d8c2103a2e Make xgetchar() return an int like getchar() does, and remove needless cast. 2019-02-28 17:41:27 +00:00
martin
a7fc6d1692 Add an option to supress the vertical space between menu title and
menu items.
2019-02-25 20:47:37 +00:00
uwe
c07928f07f Check getchar() result for EOF.
Call cleanup(SIGHUP) if we get local EOF, as if we've got SIGHUP.
While here, use EOF constant instead of literal -1 in an existing
check.

PR bin/53996
2019-02-22 22:25:22 +00:00
martin
37df7b8973 Typo in member variable name 2019-02-16 19:09:07 +00:00
martin
c8239d06af Document return values from menu items opt_action functions, add a
new variant: -1 when functions have fundamentally changed the menu
definition on the fly and the processing functions needs to restart
without looking at the old state (or stale cached pointers).
2019-02-16 18:57:21 +00:00
kre
63ba0d5a97 PR bin/53986 from Christian Weisgerber
Skip forward to tomorrow to run a command earlier in the current
hour than now (as well as during an earlier hour of the day).
2019-02-16 17:56:57 +00:00
gutteridge
1c2ba908cc make(1): minor grammar fixes in BUGS section 2019-02-16 07:41:12 +00:00
mrg
d40c522149 remove the hack to remove .eh_frame -- gcc7 is fixed it seems. 2019-02-14 12:22:06 +00:00
mrg
26711b697b while we're still figuring out the gcc7 vs .eh_frame issue, apply
the don't remove eh_frame hack to mips as well.  hpcmips testbed
is also failing currently:

[   3.1238738] panic: init died (signal 6, exit 12)
2019-02-13 20:48:56 +00:00
mrg
91af807154 hack alert time:
on sparc and sparc64, don't remove .eh_frame section.  it leads
to failure as something is referenced, and objcopy ends up
emitting a broken binary that can't be run -- it attempts to
load at va=0, beyond having missing referenced data.

also, on sparc64 also don't remove .note.netbsd.mcmodel.


the former should be revised when we can avoid it.
2019-02-12 10:16:58 +00:00
martin
fbb0a702e6 Provide an accessor for the menu description structure by manu identifier.
Usefull for dynamic menus where you want to change details on the
fly "from the outside" (i.e. while not in one of the callback functions).
2019-02-06 20:08:15 +00:00
rin
3a204f953a Make cu(1) and tip(1) recognize newline (^J) as end-of-line.
Now, tilde (~) after newline works as escape character as in ssh(1).
No objections when proposed on tech-userland.
2019-02-06 14:08:50 +00:00
martin
c3c1b1c5e7 Try to avoid a (bogus) fatal warning from clang. 2019-02-06 07:56:42 +00:00
mrg
97ee1e16ff rework the previous to only apply if !HOSTPROG 2019-02-04 10:03:16 +00:00
mrg
a5ca97c6e5 apply -Wno-error=implicit-fallthrough on files that have fallthru
comments but are missed by the current checker.
2019-02-04 09:51:47 +00:00
mrg
e79f0588d7 avoid a potential buffer truncation. 2019-02-04 08:07:33 +00:00
mrg
a6590737cd - add justquit() that always exits. use it to avoid unreachable code. 2019-02-04 04:09:13 +00:00
mrg
a0193bc54d - use -Wno-error=format-truncation 2019-02-04 03:58:41 +00:00
mrg
85f6c4cfe8 don't build ldd64 support if !MKCOMPAT and mips64. 2019-02-04 00:05:20 +00:00
mrg
37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
thorpej
68e270a267 Implement support for "pshared" POSIX semaphores.
Fixes lib/53273 (and Firefox's multi-process tab feature).
2019-02-03 03:20:23 +00:00
mrg
fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
mrg
2235c7e9bc make a fallthru comment GCC7 compatible. 2019-02-01 08:37:21 +00:00
mrg
684b182f81 compare pointers with NULL not '\0'. 2019-02-01 08:29:03 +00:00
christos
44671790a5 PR/53916: Rob Gill: remove redundant assignment to matchlen. 2019-01-28 12:04:16 +00:00
kre
d5635413aa Revert previous, it was based upon a misreading of the POSIX
spec.   POSIX requires "as if by calling strtod()" which we
did already ... by calling strtod().   Go back to doing that.
2019-01-27 12:03:09 +00:00
kre
636d0f3dee Fix merge botch 2019-01-27 05:16:55 +00:00
kre
0eb8e4ef15 Fix merge botch 2019-01-27 05:15:42 +00:00
kre
1300bdf616 Fix merge botch 2019-01-27 05:14:45 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
kre
4ca169f245 Always convert input numbers (from the command line) in the C
locale, not as set in the environment.   Conforms with POSIX spec.
2019-01-26 15:22:54 +00:00
christos
ace5fc6aeb no need for curses.h 2019-01-25 15:34:22 +00:00
christos
6b2ce0800e PR/53906: Paul Ripke: systat(1) vmstat & syscall get
"alternate system clock has died" on terminal resize (SIGWINCH)
2019-01-25 15:31:11 +00:00
martin
cf341f607a Support redrawing all windows when in a msg prompt via Ctrl-l. 2019-01-22 18:39:49 +00:00
martin
0053548254 msg_prompt_win: if the default string fits, show it separately even
in fixed size windows. Previously it would only show up when auto-sizing
prompts figured it would fit (probably an oversight).
2019-01-21 20:28:08 +00:00
uwe
a73c12be45 .Pp before .Bd is redundant.
From Edgar Pettijohn.
2019-01-13 16:48:51 +00:00
martin
8a7549a99f Allow argument expansion in menu titles as well. 2019-01-09 19:43:37 +00:00
tih
b953ff3f9a Remove a format character from a non-format string. 2019-01-08 08:22:20 +00:00
martin
afdad64472 Fix a potential NULL deref in previous - some menus start up with no
"opts" array allocated yet.
2019-01-06 11:08:34 +00:00
maya
8a135c6afb Match the function prototype of encrypthandler instead of casting to it.
Make GCC 9 snapshot happier with the code

While here, remove unnecessary braces around return (KNF).
2019-01-05 08:55:58 +00:00
maya
f96d98db06 Bump WARNS to 5, and remove unnecessary -Wno (tested with pkgsrc clang 7) 2019-01-05 06:59:46 +00:00
maya
d9e6b51adf Remove advertising clause, permitted by the copyright author. 2019-01-05 06:56:03 +00:00
maya
68daebb7bc unifdef compatibility for old BSD servers. This has been
disabled, so no binary change. from openbsd.
2019-01-05 06:47:24 +00:00
maya
28da966269 Avoid unnecessary casts, from openbsd. No binary change. 2019-01-05 06:30:05 +00:00
christos
681a027a82 recognize destructor attribute. 2019-01-04 18:51:23 +00:00
martin
b8b0f2eea4 Add an option for single (disabled) menu lines to have no shortcut. 2019-01-04 15:27:19 +00:00
martin
01b87e76cf If a menu starts with disabled options, skip those and start at the
first enabled one instead.
2019-01-02 16:32:59 +00:00