From 2d01e1a152fcacd5ad5bae8eba05341285a4c87e Mon Sep 17 00:00:00 2001 From: purplerain Date: Sat, 24 Aug 2024 02:22:20 +0000 Subject: [PATCH] sync with OpenBSD -current --- distrib/sets/lists/game/mi | 2 +- games/atc/main.c | 25 ++++--- games/quiz/Makefile | 4 +- games/quiz/datfiles/greek | 7 -- games/quiz/datfiles/index | 2 +- games/quiz/datfiles/ship | 7 ++ games/quiz/naphone2areas.sh | 38 ++++------ lib/libcurses/terminfo.5 | 22 +++--- regress/include/bitstring/bitstring_test.c | 12 +++- regress/include/bitstring/good/27 | 29 ++++++++ regress/include/bitstring/good/32 | 34 +++++++++ regress/include/bitstring/good/49 | 51 ++++++++++++++ regress/include/bitstring/good/64 | 66 ++++++++++++++++++ regress/include/bitstring/good/67 | 69 +++++++++++++++++++ regress/include/bitstring/good/8 | 10 +++ regress/lib/libcrypto/bn/bn_mod_sqrt.c | 4 +- regress/lib/libcrypto/bn/bn_word.c | 10 +-- regress/lib/libcrypto/x509/callback.c | 4 +- regress/lib/libcrypto/x509/callbackfailures.c | 4 +- regress/lib/libcrypto/x509/expirecallback.c | 4 +- regress/lib/libcrypto/x509/policy/policy.c | 4 +- regress/lib/libcrypto/x509/verify.c | 4 +- .../lib/libssl/key_schedule/key_schedule.c | 4 +- regress/libexec/ld.so/hidden/libaa/aa.c | 4 +- regress/libexec/ld.so/hidden/libab/ab.c | 4 +- regress/libexec/ld.so/hidden/test1/test1.c | 14 ++-- regress/libexec/ld.so/hidden/test2/test2.c | 6 +- regress/libexec/ld.so/lazy/libfoo/foo.c | 4 +- regress/libexec/ld.so/lazy/prog/prog.c | 4 +- regress/sbin/pfctl/changerule.c | 6 +- regress/sys/arch/amd64/vmm/vcpu.c | 6 +- regress/sys/dev/kcov/kcov.c | 10 +-- regress/sys/kern/cmsgsize/cmsgsize.c | 6 +- regress/sys/kern/getpeereid/getpeereid_test.c | 7 +- regress/sys/kern/signal/sig-stop/sig-stop.c | 4 +- regress/sys/kern/unveil/syscalls.c | 4 +- regress/sys/net/rtable/util.c | 16 ++--- regress/usr.bin/openssl/appstest.sh | 5 +- regress/usr.sbin/rpki-client/test-ip.c | 4 +- share/tabset/Makefile | 11 +-- share/tabset/gentabset.sh | 25 +++++++ share/tabset/std | 1 - share/tabset/stdcrt | 1 - share/tabset/vt100 | 3 - share/tabset/vt300 | 3 - usr.bin/ssh/cipher.c | 6 +- usr.bin/ssh/kex.c | 4 +- usr.bin/ssh/kex.h | 4 +- usr.bin/ssh/packet.c | 7 +- usr.bin/ssh/readconf.c | 4 +- usr.bin/tmux/input-keys.c | 14 ++-- usr.bin/tmux/key-string.c | 4 +- usr.bin/tmux/layout-set.c | 6 +- usr.bin/tmux/tmux.h | 5 +- usr.bin/tput/tput.1 | 6 +- usr.bin/tset/tset.1 | 16 ++--- 56 files changed, 465 insertions(+), 175 deletions(-) delete mode 100644 games/quiz/datfiles/greek create mode 100644 games/quiz/datfiles/ship create mode 100644 share/tabset/gentabset.sh delete mode 100644 share/tabset/std delete mode 100644 share/tabset/stdcrt delete mode 100644 share/tabset/vt100 delete mode 100644 share/tabset/vt300 diff --git a/distrib/sets/lists/game/mi b/distrib/sets/lists/game/mi index af0df9170..aff1b8f12 100644 --- a/distrib/sets/lists/game/mi +++ b/distrib/sets/lists/game/mi @@ -103,7 +103,6 @@ ./usr/share/games/quiz.db/elements ./usr/share/games/quiz.db/europe ./usr/share/games/quiz.db/flowers -./usr/share/games/quiz.db/greek ./usr/share/games/quiz.db/inca ./usr/share/games/quiz.db/index ./usr/share/games/quiz.db/latin @@ -119,6 +118,7 @@ ./usr/share/games/quiz.db/seq-easy ./usr/share/games/quiz.db/seq-hard ./usr/share/games/quiz.db/sexes +./usr/share/games/quiz.db/ship ./usr/share/games/quiz.db/sov ./usr/share/games/quiz.db/state ./usr/share/games/quiz.db/trek diff --git a/games/atc/main.c b/games/atc/main.c index 8c68bf3da..1382c4a80 100644 --- a/games/atc/main.c +++ b/games/atc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.32 2024/08/23 04:25:46 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.33 2024/08/23 14:50:16 deraadt Exp $ */ /* $NetBSD: main.c,v 1.4 1995/04/27 21:22:25 mycroft Exp $ */ /*- @@ -218,7 +218,7 @@ default_game(void) { FILE *fp; static char file[256]; - char line[256], games[256]; + char line[256], games[256], *p; strlcpy(games, _PATH_GAMES, sizeof games); strlcat(games, GAMES, sizeof games); @@ -233,10 +233,13 @@ default_game(void) fclose(fp); return (NULL); } - } while (line[0] == '#'); + line[strcspn(line, "\n")] = '\0'; + p = strrchr(line, '#'); + if (p) + *p = '\0'; + } while (line[0] == '\0'); fclose(fp); - line[strcspn(line, "\n")] = '\0'; if (strlen(line) + strlen(_PATH_GAMES) >= sizeof(file)) { warnx("default game name too long"); return (NULL); @@ -252,7 +255,7 @@ okay_game(const char *s) FILE *fp; static char file[256]; const char *ret = NULL; - char line[256], games[256]; + char line[256], games[256], *p; strlcpy(games, _PATH_GAMES, sizeof games); strlcat(games, GAMES, sizeof games); @@ -263,8 +266,9 @@ okay_game(const char *s) } while (fgets(line, sizeof(line), fp) != NULL) { line[strcspn(line, "\n")] = '\0'; - if (line[0] == '#') - continue; + p = strrchr(line, '#'); + if (p) + *p = '\0'; if (strcmp(s, line) == 0) { if (strlen(line) + strlen(_PATH_GAMES) >= sizeof(file)) { warnx("game name too long"); @@ -291,7 +295,7 @@ int list_games(void) { FILE *fp; - char line[256], games[256]; + char line[256], games[256], *p; int num_games = 0; strlcpy(games, _PATH_GAMES, sizeof games); @@ -304,6 +308,11 @@ list_games(void) puts("available games:"); while (fgets(line, sizeof(line), fp) != NULL) { line[strcspn(line, "\n")] = '\0'; + p = strrchr(line, '#'); + if (p) + *p = '\0'; + if (line[0] == '\0') + continue; printf(" %s\n", line); num_games++; } diff --git a/games/quiz/Makefile b/games/quiz/Makefile index 6a6d948c0..c537a6a29 100644 --- a/games/quiz/Makefile +++ b/games/quiz/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.8 2024/08/23 02:46:09 deraadt Exp $ +# $OpenBSD: Makefile,v 1.9 2024/08/23 17:29:08 deraadt Exp $ PROG= quiz MAN= quiz.6 SRCS= quiz.c rxp.c CATS= africa america arith asia babies bard chinese collectives \ - ed elements europe flowers greek inca index latin locomotive \ + ed elements europe flowers ship inca index latin locomotive \ midearth morse mult murders poetry posneg pres province seq-easy \ seq-hard sexes sov state trek ucc diff --git a/games/quiz/datfiles/greek b/games/quiz/datfiles/greek deleted file mode 100644 index 4833e8361..000000000 --- a/games/quiz/datfiles/greek +++ /dev/null @@ -1,7 +0,0 @@ -$luw$:{I} [loose|destroy] -$eluon$:{I} [loosed|destroyed|was loosing|was destroying] -$elusa$:{I} [loosed|destroyed] -$leluka$:{I} have [loosed|destroyed] -$lusw$:{I} will [loose|destroy] -$luswn$:[loosing|destroying] -$lusas$:{having} [loosed|destroyed] diff --git a/games/quiz/datfiles/index b/games/quiz/datfiles/index index a66814faf..9e3c24793 100644 --- a/games/quiz/datfiles/index +++ b/games/quiz/datfiles/index @@ -11,7 +11,7 @@ /usr/share/games/quiz.db/elements:symbol:number:weight:element /usr/share/games/quiz.db/europe:Europe{an}:cap{ital} /usr/share/games/quiz.db/flowers:flower{s}:meaning -/usr/share/games/quiz.db/greek:greek:english +/usr/share/games/quiz.db/ship:description:part /usr/share/games/quiz.db/inca:inca:succ{essor} /usr/share/games/quiz.db/latin:latin:english /usr/share/games/quiz.db/locomotive:locomotive:name diff --git a/games/quiz/datfiles/ship b/games/quiz/datfiles/ship new file mode 100644 index 000000000..5eb9db177 --- /dev/null +++ b/games/quiz/datfiles/ship @@ -0,0 +1,7 @@ +galley front:bow +galley rear:stern +watertight galley body:hull +fabric for wind propulsion:sail +blade for water propulsion:oar +galley's main weapon:ram +vertical spar:mast diff --git a/games/quiz/naphone2areas.sh b/games/quiz/naphone2areas.sh index febfa3fbf..aac47d3ee 100755 --- a/games/quiz/naphone2areas.sh +++ b/games/quiz/naphone2areas.sh @@ -10,30 +10,16 @@ if [ X"$1" == X"" ]; then exit 1 fi -AC=0 -grep -v '\#' $1 | grep -v '\$' | \ -while T= read -r line; do - AC_LAST=$AC - AC=`echo $line | cut -d: -f1` +awk '{ + split($0, a, ":"); - # skip line if area code isn't numeric - CMD=`echo $AC | grep "^[0-9]*$"` - if [ $? -eq 1 ]; then - continue - fi - - # skip line if area code is a duplicate - if [ $AC -eq $AC_LAST ]; then - continue - fi - - C=`echo $line | cut -d: -f2` - SP=`echo $line | cut -d: -f3` - SPA=`echo $line | cut -d: -f4` - - if [ X"$SPA" == X"" ]; then - echo "$AC:$SP:$C" - else - echo "$AC:$SP|$SPA:$C" - fi -done + if (a[1] ~ /^[0-9]+$/) { + if (last != a[1]) { + if (a[4] == "") + print a[1] ":" a[3] ":" a[2]; + else + print a[1] ":" a[3] "|" a[4] ":" a[2]; + } + } + last = a[1]; +}' $1 diff --git a/lib/libcurses/terminfo.5 b/lib/libcurses/terminfo.5 index f79728bbb..634390851 100644 --- a/lib/libcurses/terminfo.5 +++ b/lib/libcurses/terminfo.5 @@ -33,7 +33,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: terminfo.5,v 1.2 2023/10/17 09:52:08 nicm Exp $ +.\" $Id: terminfo.5,v 1.3 2024/08/23 15:10:40 nicm Exp $ .TH terminfo 5 2023-07-01 "ncurses 6.4" "File formats" .ds n 5 .ds d /usr/share/terminfo @@ -73,8 +73,8 @@ used by screen-oriented programs such as and other curses applications, using high-level calls to libraries such as \fBcurses\fP(3). It is also used via low-level calls by non-curses applications -which may be screen-oriented (such as \fB?\fP(1)) -or non-screen (such as \fB?\fP(1)). +which may be screen-oriented (such as \fBclear\fP(1)) +or non-screen (such as \fBtabs\fP(1)). .PP .I Terminfo describes terminals by giving a set of capabilities which they @@ -1784,7 +1784,7 @@ T} .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: terminfo.5,v 1.2 2023/10/17 09:52:08 nicm Exp $ +.\" $Id: terminfo.5,v 1.3 2024/08/23 15:10:40 nicm Exp $ .ps +1 .SS User-Defined Capabilities . @@ -3140,7 +3140,7 @@ and respectively. These strings are output by \fIreset\fP option of \fBtput\fP, -or by the \fB?\fP program +or by the \fBreset\fP program (an alias of \fBtset\fP), which is used when the terminal gets into a wedged state. Commands are normally placed in @@ -3157,7 +3157,7 @@ normally be part of but it causes an annoying glitch of the screen and is not normally needed since the terminal is usually already in 80-column mode. .PP -The \fB?\fP program writes strings including +The \fBreset\fP program writes strings including .BR iprog , etc., in the same order as the .I init @@ -3173,7 +3173,7 @@ If any of or .B rf reset capability strings are missing, -the \fB?\fP program +the \fBreset\fP program falls back upon the corresponding initialization capability string. .PP If there are commands to set and clear tab stops, they can be given as @@ -3189,13 +3189,13 @@ or .BR if . .PP The \fBtput reset\fP command uses the same capability strings -as the \fB?\fP command, -although the two programs (\fBtput\fP and \fB?\fP) +as the \fBreset\fP command, +although the two programs (\fBtput\fP and \fBreset\fP) provide different command-line options. .PP In practice, these terminfo capabilities are not often used in initialization of tabs -(though they are required for the \fB?\fP program): +(though they are required for the \fBtabs\fP program): .bP Almost all hardware terminals (at least those which supported tabs) initialized those to every \fIeight\fP columns: @@ -3828,7 +3828,7 @@ files containing terminal descriptions .na .hy 0 \fBinfocmp\fP(1), -\fB?\fP(1), +\fBtabs\fP(1), \fBtic\fP(1), \fBcurses\fP(3), \fBcurs_color\fP(3), diff --git a/regress/include/bitstring/bitstring_test.c b/regress/include/bitstring/bitstring_test.c index 545a3cb79..836c021bf 100644 --- a/regress/include/bitstring/bitstring_test.c +++ b/regress/include/bitstring/bitstring_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bitstring_test.c,v 1.5 2003/07/31 21:48:02 deraadt Exp $ */ +/* $OpenBSD: bitstring_test.c,v 1.6 2024/08/23 17:19:16 florian Exp $ */ /* $NetBSD: bitstring_test.c,v 1.4 1995/04/29 05:44:35 cgd Exp $ */ /* @@ -210,6 +210,16 @@ main(int argc, char *argv[]) printbits(bs, TEST_LENGTH); } + (void) printf("\n"); + (void) printf("CHI square test\n"); + for (i = 0; i < TEST_LENGTH; i++) { + bit_nclear(bs, 0, TEST_LENGTH - 1); + bit_nset(bs, i, i); + bit_nset(bs, TEST_LENGTH - 1 - i, TEST_LENGTH - 1 - i); + (void) printf("%3d ", i); + printbits(bs, TEST_LENGTH); + } + (void) free(bs); (void) exit(0); } diff --git a/regress/include/bitstring/good/27 b/regress/include/bitstring/good/27 index 55ba39e77..f1479dde8 100644 --- a/regress/include/bitstring/good/27 +++ b/regress/include/bitstring/good/27 @@ -261,3 +261,32 @@ first 1 bit should move left 1 position each line 24 0 24 000000000000000000000000100 25 0 25 000000000000000000000000010 26 0 26 000000000000000000000000001 + +CHI square test + 0 1 0 100000000000000000000000001 + 1 0 1 010000000000000000000000010 + 2 0 2 001000000000000000000000100 + 3 0 3 000100000000000000000001000 + 4 0 4 000010000000000000000010000 + 5 0 5 000001000000000000000100000 + 6 0 6 000000100000000000001000000 + 7 0 7 000000010000000000010000000 + 8 0 8 000000001000000000100000000 + 9 0 9 000000000100000001000000000 + 10 0 10 000000000010000010000000000 + 11 0 11 000000000001000100000000000 + 12 0 12 000000000000101000000000000 + 13 0 13 000000000000010000000000000 + 14 0 12 000000000000101000000000000 + 15 0 11 000000000001000100000000000 + 16 0 10 000000000010000010000000000 + 17 0 9 000000000100000001000000000 + 18 0 8 000000001000000000100000000 + 19 0 7 000000010000000000010000000 + 20 0 6 000000100000000000001000000 + 21 0 5 000001000000000000000100000 + 22 0 4 000010000000000000000010000 + 23 0 3 000100000000000000000001000 + 24 0 2 001000000000000000000000100 + 25 0 1 010000000000000000000000010 + 26 1 0 100000000000000000000000001 diff --git a/regress/include/bitstring/good/32 b/regress/include/bitstring/good/32 index 2e1ca55d6..7474b9662 100644 --- a/regress/include/bitstring/good/32 +++ b/regress/include/bitstring/good/32 @@ -301,3 +301,37 @@ first 1 bit should move left 1 position each line 29 0 29 00000000000000000000000000000100 30 0 30 00000000000000000000000000000010 31 0 31 00000000000000000000000000000001 + +CHI square test + 0 1 0 10000000000000000000000000000001 + 1 0 1 01000000000000000000000000000010 + 2 0 2 00100000000000000000000000000100 + 3 0 3 00010000000000000000000000001000 + 4 0 4 00001000000000000000000000010000 + 5 0 5 00000100000000000000000000100000 + 6 0 6 00000010000000000000000001000000 + 7 0 7 00000001000000000000000010000000 + 8 0 8 00000000100000000000000100000000 + 9 0 9 00000000010000000000001000000000 + 10 0 10 00000000001000000000010000000000 + 11 0 11 00000000000100000000100000000000 + 12 0 12 00000000000010000001000000000000 + 13 0 13 00000000000001000010000000000000 + 14 0 14 00000000000000100100000000000000 + 15 0 15 00000000000000011000000000000000 + 16 0 15 00000000000000011000000000000000 + 17 0 14 00000000000000100100000000000000 + 18 0 13 00000000000001000010000000000000 + 19 0 12 00000000000010000001000000000000 + 20 0 11 00000000000100000000100000000000 + 21 0 10 00000000001000000000010000000000 + 22 0 9 00000000010000000000001000000000 + 23 0 8 00000000100000000000000100000000 + 24 0 7 00000001000000000000000010000000 + 25 0 6 00000010000000000000000001000000 + 26 0 5 00000100000000000000000000100000 + 27 0 4 00001000000000000000000000010000 + 28 0 3 00010000000000000000000000001000 + 29 0 2 00100000000000000000000000000100 + 30 0 1 01000000000000000000000000000010 + 31 1 0 10000000000000000000000000000001 diff --git a/regress/include/bitstring/good/49 b/regress/include/bitstring/good/49 index d63c0692d..42e55b337 100644 --- a/regress/include/bitstring/good/49 +++ b/regress/include/bitstring/good/49 @@ -437,3 +437,54 @@ first 1 bit should move left 1 position each line 46 0 46 0000000000000000000000000000000000000000000000100 47 0 47 0000000000000000000000000000000000000000000000010 48 0 48 0000000000000000000000000000000000000000000000001 + +CHI square test + 0 1 0 1000000000000000000000000000000000000000000000001 + 1 0 1 0100000000000000000000000000000000000000000000010 + 2 0 2 0010000000000000000000000000000000000000000000100 + 3 0 3 0001000000000000000000000000000000000000000001000 + 4 0 4 0000100000000000000000000000000000000000000010000 + 5 0 5 0000010000000000000000000000000000000000000100000 + 6 0 6 0000001000000000000000000000000000000000001000000 + 7 0 7 0000000100000000000000000000000000000000010000000 + 8 0 8 0000000010000000000000000000000000000000100000000 + 9 0 9 0000000001000000000000000000000000000001000000000 + 10 0 10 0000000000100000000000000000000000000010000000000 + 11 0 11 0000000000010000000000000000000000000100000000000 + 12 0 12 0000000000001000000000000000000000001000000000000 + 13 0 13 0000000000000100000000000000000000010000000000000 + 14 0 14 0000000000000010000000000000000000100000000000000 + 15 0 15 0000000000000001000000000000000001000000000000000 + 16 0 16 0000000000000000100000000000000010000000000000000 + 17 0 17 0000000000000000010000000000000100000000000000000 + 18 0 18 0000000000000000001000000000001000000000000000000 + 19 0 19 0000000000000000000100000000010000000000000000000 + 20 0 20 0000000000000000000010000000100000000000000000000 + 21 0 21 0000000000000000000001000001000000000000000000000 + 22 0 22 0000000000000000000000100010000000000000000000000 + 23 0 23 0000000000000000000000010100000000000000000000000 + 24 0 24 0000000000000000000000001000000000000000000000000 + 25 0 23 0000000000000000000000010100000000000000000000000 + 26 0 22 0000000000000000000000100010000000000000000000000 + 27 0 21 0000000000000000000001000001000000000000000000000 + 28 0 20 0000000000000000000010000000100000000000000000000 + 29 0 19 0000000000000000000100000000010000000000000000000 + 30 0 18 0000000000000000001000000000001000000000000000000 + 31 0 17 0000000000000000010000000000000100000000000000000 + 32 0 16 0000000000000000100000000000000010000000000000000 + 33 0 15 0000000000000001000000000000000001000000000000000 + 34 0 14 0000000000000010000000000000000000100000000000000 + 35 0 13 0000000000000100000000000000000000010000000000000 + 36 0 12 0000000000001000000000000000000000001000000000000 + 37 0 11 0000000000010000000000000000000000000100000000000 + 38 0 10 0000000000100000000000000000000000000010000000000 + 39 0 9 0000000001000000000000000000000000000001000000000 + 40 0 8 0000000010000000000000000000000000000000100000000 + 41 0 7 0000000100000000000000000000000000000000010000000 + 42 0 6 0000001000000000000000000000000000000000001000000 + 43 0 5 0000010000000000000000000000000000000000000100000 + 44 0 4 0000100000000000000000000000000000000000000010000 + 45 0 3 0001000000000000000000000000000000000000000001000 + 46 0 2 0010000000000000000000000000000000000000000000100 + 47 0 1 0100000000000000000000000000000000000000000000010 + 48 1 0 1000000000000000000000000000000000000000000000001 diff --git a/regress/include/bitstring/good/64 b/regress/include/bitstring/good/64 index 7e9308eab..deb94b6c7 100644 --- a/regress/include/bitstring/good/64 +++ b/regress/include/bitstring/good/64 @@ -557,3 +557,69 @@ first 1 bit should move left 1 position each line 61 0 61 0000000000000000000000000000000000000000000000000000000000000100 62 0 62 0000000000000000000000000000000000000000000000000000000000000010 63 0 63 0000000000000000000000000000000000000000000000000000000000000001 + +CHI square test + 0 1 0 1000000000000000000000000000000000000000000000000000000000000001 + 1 0 1 0100000000000000000000000000000000000000000000000000000000000010 + 2 0 2 0010000000000000000000000000000000000000000000000000000000000100 + 3 0 3 0001000000000000000000000000000000000000000000000000000000001000 + 4 0 4 0000100000000000000000000000000000000000000000000000000000010000 + 5 0 5 0000010000000000000000000000000000000000000000000000000000100000 + 6 0 6 0000001000000000000000000000000000000000000000000000000001000000 + 7 0 7 0000000100000000000000000000000000000000000000000000000010000000 + 8 0 8 0000000010000000000000000000000000000000000000000000000100000000 + 9 0 9 0000000001000000000000000000000000000000000000000000001000000000 + 10 0 10 0000000000100000000000000000000000000000000000000000010000000000 + 11 0 11 0000000000010000000000000000000000000000000000000000100000000000 + 12 0 12 0000000000001000000000000000000000000000000000000001000000000000 + 13 0 13 0000000000000100000000000000000000000000000000000010000000000000 + 14 0 14 0000000000000010000000000000000000000000000000000100000000000000 + 15 0 15 0000000000000001000000000000000000000000000000001000000000000000 + 16 0 16 0000000000000000100000000000000000000000000000010000000000000000 + 17 0 17 0000000000000000010000000000000000000000000000100000000000000000 + 18 0 18 0000000000000000001000000000000000000000000001000000000000000000 + 19 0 19 0000000000000000000100000000000000000000000010000000000000000000 + 20 0 20 0000000000000000000010000000000000000000000100000000000000000000 + 21 0 21 0000000000000000000001000000000000000000001000000000000000000000 + 22 0 22 0000000000000000000000100000000000000000010000000000000000000000 + 23 0 23 0000000000000000000000010000000000000000100000000000000000000000 + 24 0 24 0000000000000000000000001000000000000001000000000000000000000000 + 25 0 25 0000000000000000000000000100000000000010000000000000000000000000 + 26 0 26 0000000000000000000000000010000000000100000000000000000000000000 + 27 0 27 0000000000000000000000000001000000001000000000000000000000000000 + 28 0 28 0000000000000000000000000000100000010000000000000000000000000000 + 29 0 29 0000000000000000000000000000010000100000000000000000000000000000 + 30 0 30 0000000000000000000000000000001001000000000000000000000000000000 + 31 0 31 0000000000000000000000000000000110000000000000000000000000000000 + 32 0 31 0000000000000000000000000000000110000000000000000000000000000000 + 33 0 30 0000000000000000000000000000001001000000000000000000000000000000 + 34 0 29 0000000000000000000000000000010000100000000000000000000000000000 + 35 0 28 0000000000000000000000000000100000010000000000000000000000000000 + 36 0 27 0000000000000000000000000001000000001000000000000000000000000000 + 37 0 26 0000000000000000000000000010000000000100000000000000000000000000 + 38 0 25 0000000000000000000000000100000000000010000000000000000000000000 + 39 0 24 0000000000000000000000001000000000000001000000000000000000000000 + 40 0 23 0000000000000000000000010000000000000000100000000000000000000000 + 41 0 22 0000000000000000000000100000000000000000010000000000000000000000 + 42 0 21 0000000000000000000001000000000000000000001000000000000000000000 + 43 0 20 0000000000000000000010000000000000000000000100000000000000000000 + 44 0 19 0000000000000000000100000000000000000000000010000000000000000000 + 45 0 18 0000000000000000001000000000000000000000000001000000000000000000 + 46 0 17 0000000000000000010000000000000000000000000000100000000000000000 + 47 0 16 0000000000000000100000000000000000000000000000010000000000000000 + 48 0 15 0000000000000001000000000000000000000000000000001000000000000000 + 49 0 14 0000000000000010000000000000000000000000000000000100000000000000 + 50 0 13 0000000000000100000000000000000000000000000000000010000000000000 + 51 0 12 0000000000001000000000000000000000000000000000000001000000000000 + 52 0 11 0000000000010000000000000000000000000000000000000000100000000000 + 53 0 10 0000000000100000000000000000000000000000000000000000010000000000 + 54 0 9 0000000001000000000000000000000000000000000000000000001000000000 + 55 0 8 0000000010000000000000000000000000000000000000000000000100000000 + 56 0 7 0000000100000000000000000000000000000000000000000000000010000000 + 57 0 6 0000001000000000000000000000000000000000000000000000000001000000 + 58 0 5 0000010000000000000000000000000000000000000000000000000000100000 + 59 0 4 0000100000000000000000000000000000000000000000000000000000010000 + 60 0 3 0001000000000000000000000000000000000000000000000000000000001000 + 61 0 2 0010000000000000000000000000000000000000000000000000000000000100 + 62 0 1 0100000000000000000000000000000000000000000000000000000000000010 + 63 1 0 1000000000000000000000000000000000000000000000000000000000000001 diff --git a/regress/include/bitstring/good/67 b/regress/include/bitstring/good/67 index e5decc3b4..83cd3fdf0 100644 --- a/regress/include/bitstring/good/67 +++ b/regress/include/bitstring/good/67 @@ -581,3 +581,72 @@ first 1 bit should move left 1 position each line 64 0 64 0000000000000000000000000000000000000000000000000000000000000000100 65 0 65 0000000000000000000000000000000000000000000000000000000000000000010 66 0 66 0000000000000000000000000000000000000000000000000000000000000000001 + +CHI square test + 0 1 0 1000000000000000000000000000000000000000000000000000000000000000001 + 1 0 1 0100000000000000000000000000000000000000000000000000000000000000010 + 2 0 2 0010000000000000000000000000000000000000000000000000000000000000100 + 3 0 3 0001000000000000000000000000000000000000000000000000000000000001000 + 4 0 4 0000100000000000000000000000000000000000000000000000000000000010000 + 5 0 5 0000010000000000000000000000000000000000000000000000000000000100000 + 6 0 6 0000001000000000000000000000000000000000000000000000000000001000000 + 7 0 7 0000000100000000000000000000000000000000000000000000000000010000000 + 8 0 8 0000000010000000000000000000000000000000000000000000000000100000000 + 9 0 9 0000000001000000000000000000000000000000000000000000000001000000000 + 10 0 10 0000000000100000000000000000000000000000000000000000000010000000000 + 11 0 11 0000000000010000000000000000000000000000000000000000000100000000000 + 12 0 12 0000000000001000000000000000000000000000000000000000001000000000000 + 13 0 13 0000000000000100000000000000000000000000000000000000010000000000000 + 14 0 14 0000000000000010000000000000000000000000000000000000100000000000000 + 15 0 15 0000000000000001000000000000000000000000000000000001000000000000000 + 16 0 16 0000000000000000100000000000000000000000000000000010000000000000000 + 17 0 17 0000000000000000010000000000000000000000000000000100000000000000000 + 18 0 18 0000000000000000001000000000000000000000000000001000000000000000000 + 19 0 19 0000000000000000000100000000000000000000000000010000000000000000000 + 20 0 20 0000000000000000000010000000000000000000000000100000000000000000000 + 21 0 21 0000000000000000000001000000000000000000000001000000000000000000000 + 22 0 22 0000000000000000000000100000000000000000000010000000000000000000000 + 23 0 23 0000000000000000000000010000000000000000000100000000000000000000000 + 24 0 24 0000000000000000000000001000000000000000001000000000000000000000000 + 25 0 25 0000000000000000000000000100000000000000010000000000000000000000000 + 26 0 26 0000000000000000000000000010000000000000100000000000000000000000000 + 27 0 27 0000000000000000000000000001000000000001000000000000000000000000000 + 28 0 28 0000000000000000000000000000100000000010000000000000000000000000000 + 29 0 29 0000000000000000000000000000010000000100000000000000000000000000000 + 30 0 30 0000000000000000000000000000001000001000000000000000000000000000000 + 31 0 31 0000000000000000000000000000000100010000000000000000000000000000000 + 32 0 32 0000000000000000000000000000000010100000000000000000000000000000000 + 33 0 33 0000000000000000000000000000000001000000000000000000000000000000000 + 34 0 32 0000000000000000000000000000000010100000000000000000000000000000000 + 35 0 31 0000000000000000000000000000000100010000000000000000000000000000000 + 36 0 30 0000000000000000000000000000001000001000000000000000000000000000000 + 37 0 29 0000000000000000000000000000010000000100000000000000000000000000000 + 38 0 28 0000000000000000000000000000100000000010000000000000000000000000000 + 39 0 27 0000000000000000000000000001000000000001000000000000000000000000000 + 40 0 26 0000000000000000000000000010000000000000100000000000000000000000000 + 41 0 25 0000000000000000000000000100000000000000010000000000000000000000000 + 42 0 24 0000000000000000000000001000000000000000001000000000000000000000000 + 43 0 23 0000000000000000000000010000000000000000000100000000000000000000000 + 44 0 22 0000000000000000000000100000000000000000000010000000000000000000000 + 45 0 21 0000000000000000000001000000000000000000000001000000000000000000000 + 46 0 20 0000000000000000000010000000000000000000000000100000000000000000000 + 47 0 19 0000000000000000000100000000000000000000000000010000000000000000000 + 48 0 18 0000000000000000001000000000000000000000000000001000000000000000000 + 49 0 17 0000000000000000010000000000000000000000000000000100000000000000000 + 50 0 16 0000000000000000100000000000000000000000000000000010000000000000000 + 51 0 15 0000000000000001000000000000000000000000000000000001000000000000000 + 52 0 14 0000000000000010000000000000000000000000000000000000100000000000000 + 53 0 13 0000000000000100000000000000000000000000000000000000010000000000000 + 54 0 12 0000000000001000000000000000000000000000000000000000001000000000000 + 55 0 11 0000000000010000000000000000000000000000000000000000000100000000000 + 56 0 10 0000000000100000000000000000000000000000000000000000000010000000000 + 57 0 9 0000000001000000000000000000000000000000000000000000000001000000000 + 58 0 8 0000000010000000000000000000000000000000000000000000000000100000000 + 59 0 7 0000000100000000000000000000000000000000000000000000000000010000000 + 60 0 6 0000001000000000000000000000000000000000000000000000000000001000000 + 61 0 5 0000010000000000000000000000000000000000000000000000000000000100000 + 62 0 4 0000100000000000000000000000000000000000000000000000000000000010000 + 63 0 3 0001000000000000000000000000000000000000000000000000000000000001000 + 64 0 2 0010000000000000000000000000000000000000000000000000000000000000100 + 65 0 1 0100000000000000000000000000000000000000000000000000000000000000010 + 66 1 0 1000000000000000000000000000000000000000000000000000000000000000001 diff --git a/regress/include/bitstring/good/8 b/regress/include/bitstring/good/8 index aba64404b..1def32253 100644 --- a/regress/include/bitstring/good/8 +++ b/regress/include/bitstring/good/8 @@ -109,3 +109,13 @@ first 1 bit should move left 1 position each line 5 0 5 00000100 6 0 6 00000010 7 0 7 00000001 + +CHI square test + 0 1 0 10000001 + 1 0 1 01000010 + 2 0 2 00100100 + 3 0 3 00011000 + 4 0 3 00011000 + 5 0 2 00100100 + 6 0 1 01000010 + 7 1 0 10000001 diff --git a/regress/lib/libcrypto/bn/bn_mod_sqrt.c b/regress/lib/libcrypto/bn/bn_mod_sqrt.c index 7ab790513..345ab4cb6 100644 --- a/regress/lib/libcrypto/bn/bn_mod_sqrt.c +++ b/regress/lib/libcrypto/bn/bn_mod_sqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mod_sqrt.c,v 1.10 2023/04/11 10:10:52 tb Exp $ */ +/* $OpenBSD: bn_mod_sqrt.c,v 1.11 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2022,2023 Theo Buehler @@ -2865,7 +2865,7 @@ mod_sqrt_test(struct mod_sqrt_test *test, BN_CTX *ctx) if (!BN_hex2bn(&want, test->sqrt)) errx(1, "BN_hex2bn(%s)", test->sqrt); if (!BN_mod_sub(diff, want, got, p, ctx)) - errx(1, "BN_mod_sub() failed\n"); + errx(1, "BN_mod_sub() failed"); if (!BN_is_zero(diff)) { fprintf(stderr, "a: %s\n", test->a); diff --git a/regress/lib/libcrypto/bn/bn_word.c b/regress/lib/libcrypto/bn/bn_word.c index 0a543add9..2ec518ed1 100644 --- a/regress/lib/libcrypto/bn/bn_word.c +++ b/regress/lib/libcrypto/bn/bn_word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_word.c,v 1.1 2023/03/11 14:04:21 jsing Exp $ */ +/* $OpenBSD: bn_word.c,v 1.2 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -51,7 +51,7 @@ check_bn_word_test(const char *op_name, const BIGNUM *bn, } if ((out_hex = BN_bn2hex(bn)) == NULL) - errx(1, "BN_bn2hex() failed\n"); + errx(1, "BN_bn2hex() failed"); if (strcmp(out_hex, bwt->out_hex) != 0) { fprintf(stderr, "FAIL %s: Got hex %s, want %s\n", @@ -82,7 +82,7 @@ test_bn_word(int (*bn_word_op)(BIGNUM *, BN_ULONG), const char *op_name, int failed = 0; if ((bn = BN_new()) == NULL) - errx(1, "BN_new() failed\n"); + errx(1, "BN_new() failed"); for (i = 0; i < num_tests; i++) { bwt = &bwts[i]; @@ -428,7 +428,7 @@ test_bn_div_word(void) int failed = 0; if ((bn = BN_new()) == NULL) - errx(1, "BN_new() failed\n"); + errx(1, "BN_new() failed"); for (i = 0; i < N_BN_DIV_WORD_TESTS; i++) { bwt = &bn_div_word_tests[i]; @@ -574,7 +574,7 @@ test_bn_mod_word(void) int failed = 0; if ((bn = BN_new()) == NULL) - errx(1, "BN_new() failed\n"); + errx(1, "BN_new() failed"); for (i = 0; i < N_BN_MOD_WORD_TESTS; i++) { bwt = &bn_mod_word_tests[i]; diff --git a/regress/lib/libcrypto/x509/callback.c b/regress/lib/libcrypto/x509/callback.c index a01ffd5d6..c4d1575ae 100644 --- a/regress/lib/libcrypto/x509/callback.c +++ b/regress/lib/libcrypto/x509/callback.c @@ -1,4 +1,4 @@ -/* $OpenBSD: callback.c,v 1.4 2023/01/28 19:12:20 tb Exp $ */ +/* $OpenBSD: callback.c,v 1.5 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2020 Joel Sing * Copyright (c) 2020-2021 Bob Beck @@ -158,7 +158,7 @@ verify_cert(const char *roots_dir, const char *roots_file, verify_err = X509_STORE_CTX_get_error(xsc); if (verify_err == 0) - errx(1, "Error unset on failure!\n"); + errx(1, "Error unset on failure!"); fprintf(stderr, "failed to verify at %d: %s\n", X509_STORE_CTX_get_error_depth(xsc), diff --git a/regress/lib/libcrypto/x509/callbackfailures.c b/regress/lib/libcrypto/x509/callbackfailures.c index 53570e153..923012214 100644 --- a/regress/lib/libcrypto/x509/callbackfailures.c +++ b/regress/lib/libcrypto/x509/callbackfailures.c @@ -1,4 +1,4 @@ -/* $OpenBSD: callbackfailures.c,v 1.2 2023/01/28 19:12:20 tb Exp $ */ +/* $OpenBSD: callbackfailures.c,v 1.3 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2020 Joel Sing * Copyright (c) 2020-2021 Bob Beck @@ -167,7 +167,7 @@ verify_cert(const char *roots_dir, const char *roots_file, verify_err = X509_STORE_CTX_get_error(xsc); if (verify_err == 0) - errx(1, "Error unset on failure!\n"); + errx(1, "Error unset on failure!"); fprintf(stderr, "failed to verify at %d: %s\n", X509_STORE_CTX_get_error_depth(xsc), diff --git a/regress/lib/libcrypto/x509/expirecallback.c b/regress/lib/libcrypto/x509/expirecallback.c index 88cef6fd0..bd3f568f8 100644 --- a/regress/lib/libcrypto/x509/expirecallback.c +++ b/regress/lib/libcrypto/x509/expirecallback.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expirecallback.c,v 1.3 2023/01/28 19:12:20 tb Exp $ */ +/* $OpenBSD: expirecallback.c,v 1.4 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2020 Joel Sing * Copyright (c) 2020-2021 Bob Beck @@ -172,7 +172,7 @@ verify_cert(const char *roots_dir, const char *roots_file, } if (*error == 0) - errx(1, "Error unset on failure!\n"); + errx(1, "Error unset on failure!"); fprintf(stderr, "failed to verify at %d: %s\n", *error_depth, X509_verify_cert_error_string(*error)); diff --git a/regress/lib/libcrypto/x509/policy/policy.c b/regress/lib/libcrypto/x509/policy/policy.c index f5c9700b2..17ac78dd2 100644 --- a/regress/lib/libcrypto/x509/policy/policy.c +++ b/regress/lib/libcrypto/x509/policy/policy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: policy.c,v 1.12 2023/06/02 08:35:10 tb Exp $ */ +/* $OpenBSD: policy.c,v 1.13 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2020 Joel Sing * Copyright (c) 2020-2023 Bob Beck @@ -182,7 +182,7 @@ verify_cert(const char *roots_file, const char *intermediate_file, } if (*error == 0) - errx(1, "Error unset on failure!\n"); + errx(1, "Error unset on failure!"); fprintf(stderr, "failed to verify at %d: %s\n", *error_depth, X509_verify_cert_error_string(*error)); diff --git a/regress/lib/libcrypto/x509/verify.c b/regress/lib/libcrypto/x509/verify.c index e49180f7f..b4b4e06cf 100644 --- a/regress/lib/libcrypto/x509/verify.c +++ b/regress/lib/libcrypto/x509/verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: verify.c,v 1.11 2023/01/28 19:12:20 tb Exp $ */ +/* $OpenBSD: verify.c,v 1.12 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2020 Joel Sing * Copyright (c) 2020-2021 Bob Beck @@ -162,7 +162,7 @@ verify_cert(const char *roots_dir, const char *roots_file, } if (*error == 0) - errx(1, "Error unset on failure!\n"); + errx(1, "Error unset on failure!"); fprintf(stderr, "failed to verify at %d: %s\n", *error_depth, X509_verify_cert_error_string(*error)); diff --git a/regress/lib/libssl/key_schedule/key_schedule.c b/regress/lib/libssl/key_schedule/key_schedule.c index f937d042c..cbf5ea9df 100644 --- a/regress/lib/libssl/key_schedule/key_schedule.c +++ b/regress/lib/libssl/key_schedule/key_schedule.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key_schedule.c,v 1.10 2022/11/26 16:08:56 tb Exp $ */ +/* $OpenBSD: key_schedule.c,v 1.11 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2018-2019 Bob Beck * @@ -188,7 +188,7 @@ main (int argc, char **argv) struct tls13_secrets *secrets; if ((secrets = tls13_secrets_create(EVP_sha256(), 0)) == NULL) - errx(1,"failed to create secrets\n"); + errx(1, "failed to create secrets"); secrets->insecure = 1; /* don't explicit_bzero when done */ diff --git a/regress/libexec/ld.so/hidden/libaa/aa.c b/regress/libexec/ld.so/hidden/libaa/aa.c index c8ea2ac28..9a7fccd9b 100644 --- a/regress/libexec/ld.so/hidden/libaa/aa.c +++ b/regress/libexec/ld.so/hidden/libaa/aa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aa.c,v 1.2 2007/08/01 12:53:28 kurt Exp $ */ +/* $OpenBSD: aa.c,v 1.3 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2007 Kurt Miller @@ -27,5 +27,5 @@ void test_aa() { libaa_hidden_val = hidden_check; if (hidden_check != &hidden_check) - errx(1, "libaa: hidden_check != &hidden_check\n"); + errx(1, "libaa: hidden_check != &hidden_check"); } diff --git a/regress/libexec/ld.so/hidden/libab/ab.c b/regress/libexec/ld.so/hidden/libab/ab.c index 9f07283a8..7fb0dc59c 100644 --- a/regress/libexec/ld.so/hidden/libab/ab.c +++ b/regress/libexec/ld.so/hidden/libab/ab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ab.c,v 1.2 2007/08/01 12:53:28 kurt Exp $ */ +/* $OpenBSD: ab.c,v 1.3 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2007 Kurt Miller @@ -27,5 +27,5 @@ void test_ab() { libab_hidden_val = hidden_check; if (hidden_check != &hidden_check) - errx(1, "libab: hidden_check != &hidden_check\n"); + errx(1, "libab: hidden_check != &hidden_check"); } diff --git a/regress/libexec/ld.so/hidden/test1/test1.c b/regress/libexec/ld.so/hidden/test1/test1.c index 151bc8e3a..c92e3b0aa 100644 --- a/regress/libexec/ld.so/hidden/test1/test1.c +++ b/regress/libexec/ld.so/hidden/test1/test1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: test1.c,v 1.3 2017/08/07 16:33:52 bluhm Exp $ */ +/* $OpenBSD: test1.c,v 1.4 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2007 Kurt Miller @@ -35,28 +35,28 @@ main() libaa = dlopen(LIBAA, RTLD_LAZY); libab = dlopen(LIBAB, RTLD_LAZY); if (libaa == NULL) - errx(1, "dlopen(%s, RTLD_LAZY) FAILED\n", LIBAA); + errx(1, "dlopen(%s, RTLD_LAZY) FAILED", LIBAA); if (libab == NULL) - errx(1, "dlopen(%s, RTLD_LAZY) FAILED\n", LIBAB); + errx(1, "dlopen(%s, RTLD_LAZY) FAILED", LIBAB); hidden_test = (void (*)())dlsym(libaa, "test_aa"); if (hidden_test == NULL) - errx(1, "dlsym(libaa, \"test_aa\") FAILED\n"); + errx(1, "dlsym(libaa, \"test_aa\") FAILED"); (*hidden_test)(); hidden_test = (void (*)())dlsym(libab, "test_ab"); if (hidden_test == NULL) - errx(1, "dlsym(libab, \"test_ab\") FAILED\n"); + errx(1, "dlsym(libab, \"test_ab\") FAILED"); (*hidden_test)(); if (hidden_check != NULL) - errx(1, "hidden_check != NULL in main prog\n"); + errx(1, "hidden_check != NULL in main prog"); if (libaa_hidden_val == NULL || libab_hidden_val == NULL || libaa_hidden_val == libab_hidden_val) - errx(1, "incorrect hidden_check detected in libs\n"); + errx(1, "incorrect hidden_check detected in libs"); dlclose(libaa); dlclose(libab); diff --git a/regress/libexec/ld.so/hidden/test2/test2.c b/regress/libexec/ld.so/hidden/test2/test2.c index 52642357f..44eb7596b 100644 --- a/regress/libexec/ld.so/hidden/test2/test2.c +++ b/regress/libexec/ld.so/hidden/test2/test2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: test2.c,v 1.3 2017/08/07 16:33:52 bluhm Exp $ */ +/* $OpenBSD: test2.c,v 1.4 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2007 Kurt Miller @@ -36,11 +36,11 @@ main() test_ab(); if (hidden_check != NULL) - errx(1, "hidden_check != NULL in main prog\n"); + errx(1, "hidden_check != NULL in main prog"); if (libaa_hidden_val == NULL || libab_hidden_val == NULL || libaa_hidden_val == libab_hidden_val) - errx(1, "incorrect hidden_check detected in libs\n"); + errx(1, "incorrect hidden_check detected in libs"); return (0); } diff --git a/regress/libexec/ld.so/lazy/libfoo/foo.c b/regress/libexec/ld.so/lazy/libfoo/foo.c index 66fedbd90..43c664ce2 100644 --- a/regress/libexec/ld.so/lazy/libfoo/foo.c +++ b/regress/libexec/ld.so/lazy/libfoo/foo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: foo.c,v 1.3 2017/08/07 16:33:52 bluhm Exp $ */ +/* $OpenBSD: foo.c,v 1.4 2024/08/23 12:56:26 anton Exp $ */ /* Public domain. 2008, Matthieu Herrb */ #include @@ -15,7 +15,7 @@ foo_init(void) printf("loading %s\n", BAR); h = dlopen(BAR, RTLD_LAZY|RTLD_GLOBAL); if (h == NULL) - errx(1, "dlopen %s: %s\n", BAR, dlerror()); + errx(1, "dlopen %s: %s", BAR, dlerror()); printf("loaded: %s\n", BAR); } diff --git a/regress/libexec/ld.so/lazy/prog/prog.c b/regress/libexec/ld.so/lazy/prog/prog.c index 1959b7108..7c60228dc 100644 --- a/regress/libexec/ld.so/lazy/prog/prog.c +++ b/regress/libexec/ld.so/lazy/prog/prog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prog.c,v 1.3 2017/02/25 07:28:32 jsg Exp $ */ +/* $OpenBSD: prog.c,v 1.4 2024/08/23 12:56:26 anton Exp $ */ /* Public Domain, 2008, Matthieu Herrb */ #include @@ -19,7 +19,7 @@ main(int argc, char *argv[]) printf("loading: %s\n", FOO); handle = dlopen(FOO, RTLD_LAZY|RTLD_GLOBAL); if (handle == NULL) { - errx(1, "dlopen: %s: %s\n", FOO, dlerror()); + errx(1, "dlopen: %s: %s", FOO, dlerror()); } printf("loaded: %s\n", FOO); printf("looking up foo\n"); diff --git a/regress/sbin/pfctl/changerule.c b/regress/sbin/pfctl/changerule.c index 8efd47d9a..5840cc37f 100644 --- a/regress/sbin/pfctl/changerule.c +++ b/regress/sbin/pfctl/changerule.c @@ -1,4 +1,4 @@ -/* $OpenBSD: changerule.c,v 1.1 2021/11/11 12:49:53 sashan Exp $ */ +/* $OpenBSD: changerule.c,v 1.2 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2021 Alexandr Nedvedicky * @@ -96,7 +96,7 @@ do_chng_cmd(char *anchorname, int cmd, int rule_no) if (strlcpy(pf.anchor->path, anchorname, sizeof(pf.anchor->path)) >= sizeof (pf.anchor->path)) - errx(1, "%s: strlcpy\n", __func__); + errx(1, "%s: strlcpy", __func__); pf.astack[0] = pf.anchor; pf.asd = 0; @@ -204,7 +204,7 @@ main(int argc, char *argv[]) int len = strlen(anchoropt); if (anchoropt[len - 1] == '*') { - warnx("wildcard anchors not supported\n"); + warnx("wildcard anchors not supported"); changerule_usage(); } if (strlcpy(anchorname, anchoropt, diff --git a/regress/sys/arch/amd64/vmm/vcpu.c b/regress/sys/arch/amd64/vmm/vcpu.c index 2c7287142..5906e8ea9 100644 --- a/regress/sys/arch/amd64/vmm/vcpu.c +++ b/regress/sys/arch/amd64/vmm/vcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vcpu.c,v 1.7 2024/04/09 21:55:16 dv Exp $ */ +/* $OpenBSD: vcpu.c,v 1.8 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2022 Dave Voutila @@ -253,7 +253,7 @@ main(int argc, char **argv) } } if (ours == NULL) { - warn("failed to find vm %uz\n", vcp.vcp_id); + warn("failed to find vm %uz", vcp.vcp_id); goto out; } @@ -306,7 +306,7 @@ main(int argc, char **argv) } if (vrunp.vrp_vm_id != vcp.vcp_id) { - warnx("expected vm id %uz, got %uz\n", vcp.vcp_id, + warnx("expected vm id %uz, got %uz", vcp.vcp_id, vrunp.vrp_vm_id); goto out; } diff --git a/regress/sys/dev/kcov/kcov.c b/regress/sys/dev/kcov/kcov.c index 7a5142ef8..7d225606b 100644 --- a/regress/sys/dev/kcov/kcov.c +++ b/regress/sys/dev/kcov/kcov.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kcov.c,v 1.17 2022/01/11 06:01:15 anton Exp $ */ +/* $OpenBSD: kcov.c,v 1.18 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2018 Anton Lindqvist @@ -197,20 +197,20 @@ check_coverage(const unsigned long *cover, int mode, unsigned long maxsize, if (nonzero == -1) { return 0; } else if (nonzero && cover[0] == 0) { - warnx("coverage empty (count=0)\n"); + warnx("coverage empty (count=0)"); return 1; } else if (!nonzero && cover[0] != 0) { - warnx("coverage not empty (count=%lu)\n", *cover); + warnx("coverage not empty (count=%lu)", *cover); return 1; } else if (cover[0] >= maxsize) { - warnx("coverage overflow (count=%lu, max=%lu)\n", + warnx("coverage overflow (count=%lu, max=%lu)", *cover, maxsize); return 1; } if (mode == KCOV_MODE_TRACE_CMP) { if (*cover * 4 >= maxsize) { - warnx("coverage cmp overflow (count=%lu, max=%lu)\n", + warnx("coverage cmp overflow (count=%lu, max=%lu)", *cover * 4, maxsize); return 1; } diff --git a/regress/sys/kern/cmsgsize/cmsgsize.c b/regress/sys/kern/cmsgsize/cmsgsize.c index 0a37847fc..b5510c196 100644 --- a/regress/sys/kern/cmsgsize/cmsgsize.c +++ b/regress/sys/kern/cmsgsize/cmsgsize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmsgsize.c,v 1.3 2020/01/22 07:52:37 deraadt Exp $ */ +/* $OpenBSD: cmsgsize.c,v 1.4 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2017 Alexander Markert * Copyright (c) 2018 Alexander Bluhm @@ -58,7 +58,7 @@ main(int argc, char *argv[]) bytes = test_cmsgsize(so, &src, &dst, CFG_SO_MAX_SEND_BUFFER, CFG_SO_MAX_SEND_BUFFER); if (bytes >= 0) - errx(1, "1: %d bytes sent\n", bytes); + errx(1, "1: %d bytes sent", bytes); if (errno != EMSGSIZE) err(-1, "1: incorrect errno"); close(so); @@ -70,7 +70,7 @@ main(int argc, char *argv[]) bytes = test_cmsgsize(so, &src, &dst, CFG_SO_MAX_SEND_BUFFER, CFG_SO_MAX_SEND_BUFFER); if (bytes >= 0) - errx(1, "2: %d bytes sent\n", bytes); + errx(1, "2: %d bytes sent", bytes); if (errno != EMSGSIZE) err(-1, "2: incorrect errno"); close(so); diff --git a/regress/sys/kern/getpeereid/getpeereid_test.c b/regress/sys/kern/getpeereid/getpeereid_test.c index 33d28c55f..7c462f502 100644 --- a/regress/sys/kern/getpeereid/getpeereid_test.c +++ b/regress/sys/kern/getpeereid/getpeereid_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getpeereid_test.c,v 1.4 2017/03/08 19:28:47 deraadt Exp $ */ +/* $OpenBSD: getpeereid_test.c,v 1.5 2024/08/23 12:56:26 anton Exp $ */ /* Written by Marc Espie in 2006 */ /* Public domain */ #include @@ -142,7 +142,8 @@ main() if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { printf("getpeereid test okay\n"); exit(0); - } else - errx(1, "Problem with child\n"); + } else { + errx(1, "Problem with child"); + } } } diff --git a/regress/sys/kern/signal/sig-stop/sig-stop.c b/regress/sys/kern/signal/sig-stop/sig-stop.c index 7f2d414e7..937592186 100644 --- a/regress/sys/kern/signal/sig-stop/sig-stop.c +++ b/regress/sys/kern/signal/sig-stop/sig-stop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig-stop.c,v 1.1 2020/09/16 14:02:23 mpi Exp $ */ +/* $OpenBSD: sig-stop.c,v 1.2 2024/08/23 12:56:26 anton Exp $ */ /* * Written by Artur Grabowski 2007 Public Domain. */ @@ -51,7 +51,7 @@ main(int argc, char **argv) (toggle ? WIFSTOPPED(status) : WIFCONTINUED(status))); if (!WIFEXITED(status)) - err(1, "bad status: %d\n", status); + err(1, "bad status: %d", status); return 0; } diff --git a/regress/sys/kern/unveil/syscalls.c b/regress/sys/kern/unveil/syscalls.c index 6a63349e0..0899aa9f3 100644 --- a/regress/sys/kern/unveil/syscalls.c +++ b/regress/sys/kern/unveil/syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscalls.c,v 1.35 2022/09/05 05:34:25 anton Exp $ */ +/* $OpenBSD: syscalls.c,v 1.36 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2017-2019 Bob Beck @@ -867,7 +867,7 @@ test_fork_locked(int do_uv) status = 0; waitpid(pid, &status, 0); if (WIFSIGNALED(status)) - errx(1, "child exited with signal %d\n", WTERMSIG(status)); + errx(1, "child exited with signal %d", WTERMSIG(status)); if (WEXITSTATUS(status) == 0) return 0; else diff --git a/regress/sys/net/rtable/util.c b/regress/sys/net/rtable/util.c index fc17db19a..1d4c52b64 100644 --- a/regress/sys/net/rtable/util.c +++ b/regress/sys/net/rtable/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.14 2023/11/11 07:34:54 anton Exp $ */ +/* $OpenBSD: util.c,v 1.15 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2015 Martin Pieuchot @@ -130,12 +130,12 @@ route_insert(unsigned int rid, sa_family_t af, char *string) if ((error = rtable_insert(rid, ndst, mask, NULL, 0, rt)) != 0) { inet_net_satop(af, ndst, plen, ip, sizeof(ip)); - errx(1, "can't add route: %s, %s\n", ip, strerror(error)); + errx(1, "can't add route: %s, %s", ip, strerror(error)); } nrt = rtable_lookup(rid, dst, mask, NULL, RTP_ANY); if (nrt != rt) { inet_net_satop(af, rt_key(rt), plen, ip, sizeof(ip)); - errx(1, "added route not found: %s\n", ip); + errx(1, "added route not found: %s", ip); } rtfree(rt); rtfree(nrt); @@ -161,7 +161,7 @@ route_delete(unsigned int rid, sa_family_t af, char *string) rt = rtable_lookup(0, dst, mask, NULL, RTP_ANY); if (rt == NULL) { inet_net_satop(af, dst, plen, ip, sizeof(ip)); - errx(1, "can't find route: %s\n", ip); + errx(1, "can't find route: %s", ip); } assert(memcmp(rt_key(rt), dst, dst->sa_len) == 0); @@ -169,7 +169,7 @@ route_delete(unsigned int rid, sa_family_t af, char *string) if ((error = rtable_delete(0, dst, mask, rt)) != 0) { inet_net_satop(af, dst, plen, ip, sizeof(ip)); - errx(1, "can't rm route: %s, %s\n", ip, strerror(error)); + errx(1, "can't rm route: %s, %s", ip, strerror(error)); } nrt = rtable_lookup(0, dst, mask, NULL, RTP_ANY); @@ -207,7 +207,7 @@ route_lookup(unsigned int rid, sa_family_t af, char *string) rt = rtable_lookup(0, dst, mask, NULL, RTP_ANY); if (rt == NULL) { inet_net_satop(af, dst, plen, ip, sizeof(ip)); - errx(1, "%s not found\n", ip); + errx(1, "%s not found", ip); } assert(memcmp(rt_key(rt), dst, dst->sa_len) == 0); assert(rt_plen(rt) == rtable_satoplen(af, mask)); @@ -225,7 +225,7 @@ do_from_file(unsigned int rid, sa_family_t af, char *filename, int lines = 0; if ((fp = fopen(filename, "r")) == NULL) - errx(1, "No such file: %s\n", filename); + errx(1, "No such file: %s", filename); while ((buf = fgetln(fp, &len)) != NULL) { if (buf[len - 1] == '\n') @@ -264,7 +264,7 @@ rtentry_delete(struct rtentry *rt, void *w, unsigned int rid) if ((error = rtable_delete(0, rt_key(rt), mask, rt)) != 0) { inet_net_satop(af, rt_key(rt), rt_plen(rt), dest, sizeof(dest)); - errx(1, "can't rm route: %s, %s\n", dest, strerror(error)); + errx(1, "can't rm route: %s, %s", dest, strerror(error)); } assert(refcnt_read(&rt->rt_refcnt) == 0); diff --git a/regress/usr.bin/openssl/appstest.sh b/regress/usr.bin/openssl/appstest.sh index 572cc7361..1912d0f88 100755 --- a/regress/usr.bin/openssl/appstest.sh +++ b/regress/usr.bin/openssl/appstest.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: appstest.sh,v 1.64 2024/07/08 06:00:34 tb Exp $ +# $OpenBSD: appstest.sh,v 1.65 2024/08/23 04:57:12 tb Exp $ # # Copyright (c) 2016 Kinichiro Inoguchi # @@ -1403,8 +1403,7 @@ function test_pkcs { -caname "caname_server_p12" \ -certpbe AES-256-CBC -keypbe AES-256-CBC -chain \ -name "name_server_p12" -des3 -maciter -macalg sha256 \ - -CSP "csp_server_p12" -LMK -keyex \ - -passout pass:$pkcs_pass -out $sv_rsa_cert.p12 + -keyex -passout pass:$pkcs_pass -out $sv_rsa_cert.p12 check_exit_status $? start_message "pkcs12 ... verify" diff --git a/regress/usr.sbin/rpki-client/test-ip.c b/regress/usr.sbin/rpki-client/test-ip.c index 57c526d1e..b996af652 100644 --- a/regress/usr.sbin/rpki-client/test-ip.c +++ b/regress/usr.sbin/rpki-client/test-ip.c @@ -1,4 +1,4 @@ -/* $Id: test-ip.c,v 1.10 2024/04/22 05:54:01 claudio Exp $ */ +/* $Id: test-ip.c,v 1.11 2024/08/23 12:56:26 anton Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -59,7 +59,7 @@ test(const char *res, uint16_t afiv, size_t sz, size_t unused, ...) addr.prefixlen = sz * 8 - unused; ip_addr_print(&addr, afi, buf, sizeof(buf)); if (res != NULL && strcmp(res, buf)) - errx(EXIT_FAILURE, "fail: %s != %s\n", res, buf); + errx(EXIT_FAILURE, "fail: %s != %s", res, buf); else if (res != NULL) warnx("pass: %s", buf); else diff --git a/share/tabset/Makefile b/share/tabset/Makefile index c90b2354f..687f9549c 100644 --- a/share/tabset/Makefile +++ b/share/tabset/Makefile @@ -1,12 +1,15 @@ -# $OpenBSD: Makefile,v 1.5 2019/12/21 21:40:01 espie Exp $ +# $OpenBSD: Makefile,v 1.6 2024/08/23 15:13:58 nicm Exp $ # from: @(#)Makefile 5.3 (Berkeley) 10/22/90 FILES= std stdcrt vt100 vt300 -NOOBJ= noobj +CLEANFILES+= ${FILES} -all clean cleandir tags: +all: ${FILES} -realinstall: +${FILES}: + sh ${.CURDIR}/gentabset.sh ${.CURDIR}/obj + +realinstall: ${FILES} install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \ ${DESTDIR}${BINDIR}/tabset diff --git a/share/tabset/gentabset.sh b/share/tabset/gentabset.sh new file mode 100644 index 000000000..da8d1fdce --- /dev/null +++ b/share/tabset/gentabset.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +DESTDIR=$1 + +# +# Write out tabset file: arguments are prefix, number of tab stops, +# tab stop sequence, postfix. +# +write_tabset() { + printf "$1" + for i in $(seq $2); do printf "$3"; done + printf "$4" +} + +# Tabset files for HP terminals. +write_tabset '\r\e3\r' 13 ' \e1' '\n' >$DESTDIR/std +write_tabset '\r\e3\r' 9 ' \e1' '' >$DESTDIR/stdcrt + +# Tabset for VT100 and derivatives. +write_tabset '\r\n\e[3g\n' 15 '\eH ' '\eH\n' >$DESTDIR/vt100 + +# Tabset for VT3xx and VT4xx and derivatives. +printf '\n\e[3g\n\eP2$t9/17/25/33/41/49/57/65/73/81/89/97/105/113/121/129\e\\\n' >$DESTDIR/vt300 + +exit 0 diff --git a/share/tabset/std b/share/tabset/std deleted file mode 100644 index e93f737f0..000000000 --- a/share/tabset/std +++ /dev/null @@ -1 +0,0 @@ - 3 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/share/tabset/stdcrt b/share/tabset/stdcrt deleted file mode 100644 index 66ba12f64..000000000 --- a/share/tabset/stdcrt +++ /dev/null @@ -1 +0,0 @@ - 3 1 1 1 1 1 1 1 1 1 \ No newline at end of file diff --git a/share/tabset/vt100 b/share/tabset/vt100 deleted file mode 100644 index 8828d19da..000000000 --- a/share/tabset/vt100 +++ /dev/null @@ -1,3 +0,0 @@ - - -H H H H H H H H H H H H H H H H diff --git a/share/tabset/vt300 b/share/tabset/vt300 deleted file mode 100644 index b1f9ce16d..000000000 --- a/share/tabset/vt300 +++ /dev/null @@ -1,3 +0,0 @@ - - -P2$t9/17/25/33/41/49/57/65/73/81/89/97/105/113/121/129\ diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c index 56be78769..bc207aa91 100644 --- a/usr.bin/ssh/cipher.c +++ b/usr.bin/ssh/cipher.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher.c,v 1.122 2024/08/14 15:42:18 tobias Exp $ */ +/* $OpenBSD: cipher.c,v 1.123 2024/08/23 04:51:00 deraadt Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -137,8 +137,8 @@ const char * compression_alg_list(int compression) { #ifdef WITH_ZLIB - return compression ? "zlib@openssh.com,zlib,none" : - "none,zlib@openssh.com,zlib"; + return compression ? "zlib@openssh.com,none" : + "none,zlib@openssh.com"; #else return "none"; #endif diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c index a99d050bb..e5142670e 100644 --- a/usr.bin/ssh/kex.c +++ b/usr.bin/ssh/kex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.c,v 1.186 2024/05/17 00:30:23 djm Exp $ */ +/* $OpenBSD: kex.c,v 1.187 2024/08/23 04:51:00 deraadt Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * @@ -835,8 +835,6 @@ choose_comp(struct sshcomp *comp, char *client, char *server) #ifdef WITH_ZLIB if (strcmp(name, "zlib@openssh.com") == 0) { comp->type = COMP_DELAYED; - } else if (strcmp(name, "zlib") == 0) { - comp->type = COMP_ZLIB; } else #endif /* WITH_ZLIB */ if (strcmp(name, "none") == 0) { diff --git a/usr.bin/ssh/kex.h b/usr.bin/ssh/kex.h index 0d66b87a9..19f6f7860 100644 --- a/usr.bin/ssh/kex.h +++ b/usr.bin/ssh/kex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.h,v 1.124 2024/08/22 23:11:30 djm Exp $ */ +/* $OpenBSD: kex.h,v 1.125 2024/08/23 04:51:00 deraadt Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -59,8 +59,6 @@ #define KEX_SNTRUP761X25519_SHA512_OLD "sntrup761x25519-sha512@openssh.com" #define COMP_NONE 0 -/* pre-auth compression (COMP_ZLIB) is only supported in the client */ -#define COMP_ZLIB 1 #define COMP_DELAYED 2 #define CURVE25519_SIZE 32 diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index 07e7e1d99..72803fdf2 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.316 2024/08/15 00:51:51 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.317 2024/08/23 04:51:00 deraadt Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -991,9 +991,8 @@ ssh_set_newkeys(struct ssh *ssh, int mode) /* explicit_bzero(enc->iv, enc->block_size); explicit_bzero(enc->key, enc->key_len); explicit_bzero(mac->key, mac->key_len); */ - if ((comp->type == COMP_ZLIB || - (comp->type == COMP_DELAYED && - state->after_authentication)) && comp->enabled == 0) { + if (((comp->type == COMP_DELAYED && state->after_authentication)) && + comp->enabled == 0) { if ((r = ssh_packet_init_compression(ssh)) < 0) return r; if (mode == MODE_OUT) { diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 2165da6a2..dfb4556c0 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.387 2024/05/17 02:39:11 jsg Exp $ */ +/* $OpenBSD: readconf.c,v 1.388 2024/08/23 04:51:00 deraadt Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -979,7 +979,7 @@ static const struct multistate multistate_pubkey_auth[] = { }; static const struct multistate multistate_compression[] = { #ifdef WITH_ZLIB - { "yes", COMP_ZLIB }, + { "yes", COMP_DELAYED }, #endif { "no", COMP_NONE }, { NULL, -1 } diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c index 348b0987b..d8dc2aa21 100644 --- a/usr.bin/tmux/input-keys.c +++ b/usr.bin/tmux/input-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input-keys.c,v 1.96 2024/08/21 04:55:57 nicm Exp $ */ +/* $OpenBSD: input-keys.c,v 1.97 2024/08/23 13:25:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -499,9 +499,8 @@ input_key_vt10x(struct bufferevent *bev, key_code key) return (0); } - onlykey = key & KEYC_MASK_KEY; - /* Prevent TAB and RET from being swallowed by C0 remapping logic. */ + onlykey = key & KEYC_MASK_KEY; if (onlykey == '\r' || onlykey == '\t') key &= ~KEYC_CTRL; @@ -594,7 +593,7 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key) /* Is this backtab? */ if ((key & KEYC_MASK_KEY) == KEYC_BTAB) { - if (s->mode & EXTENDED_KEY_MODES) { + if ((s->mode & EXTENDED_KEY_MODES) != 0) { /* When in xterm extended mode, remap into S-Tab. */ key = '\011' | (key & ~KEYC_MASK_KEY) | KEYC_SHIFT; } else { @@ -651,6 +650,13 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key) return (0); } + /* Ignore internal function key codes. */ + if ((key >= KEYC_BASE && key < KEYC_BASE_END) || + (key >= KEYC_USER && key < KEYC_USER_END)) { + log_debug("%s: ignoring key 0x%llx", __func__, key); + return (0); + } + /* * No builtin key sequence; construct an extended key sequence * depending on the client mode. diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c index 856c974fb..323600841 100644 --- a/usr.bin/tmux/key-string.c +++ b/usr.bin/tmux/key-string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-string.c,v 1.74 2024/08/22 09:05:51 nicm Exp $ */ +/* $OpenBSD: key-string.c,v 1.75 2024/08/23 13:25:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -410,7 +410,7 @@ key_string_lookup_key(key_code key, int with_flags) s = "MouseMoveBorder"; goto append; } - if (key >= KEYC_USER && key < KEYC_USER + KEYC_NUSER) { + if (key >= KEYC_USER && key < KEYC_USER_END) { snprintf(tmp, sizeof tmp, "User%u", (u_int)(key - KEYC_USER)); strlcat(out, tmp, sizeof out); goto out; diff --git a/usr.bin/tmux/layout-set.c b/usr.bin/tmux/layout-set.c index 40501964e..77eca1a92 100644 --- a/usr.bin/tmux/layout-set.c +++ b/usr.bin/tmux/layout-set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: layout-set.c,v 1.31 2024/08/21 05:03:13 nicm Exp $ */ +/* $OpenBSD: layout-set.c,v 1.32 2024/08/23 10:19:06 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -55,6 +55,10 @@ layout_set_lookup(const char *name) u_int i; int matched = -1; + for (i = 0; i < nitems(layout_sets); i++) { + if (strcmp(layout_sets[i].name, name) == 0) + return (i); + } for (i = 0; i < nitems(layout_sets); i++) { if (strncmp(layout_sets[i].name, name, strlen(name)) == 0) { if (matched != -1) /* ambiguous */ diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 7c6f7c7c8..2faaf53fd 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1221 2024/08/21 04:17:09 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1222 2024/08/23 13:25:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -125,6 +125,7 @@ struct winlink; */ #define KEYC_BASE 0x0000000010e000ULL #define KEYC_USER 0x0000000010f000ULL +#define KEYC_USER_END (KEYC_USER + KEYC_NUSER) /* Key modifier bits. */ #define KEYC_META 0x00100000000000ULL @@ -159,7 +160,7 @@ struct winlink; (((key) & KEYC_MASK_KEY) < KEYC_BASE || \ ((key) & KEYC_MASK_KEY) >= KEYC_BASE_END) && \ (((key) & KEYC_MASK_KEY) < KEYC_USER || \ - ((key) & KEYC_MASK_KEY) >= KEYC_USER + KEYC_NUSER)) + ((key) & KEYC_MASK_KEY) >= KEYC_USER_END)) /* Multiple click timeout. */ #define KEYC_CLICK_TIMEOUT 300 diff --git a/usr.bin/tput/tput.1 b/usr.bin/tput/tput.1 index d4e2561fa..31ae8b637 100644 --- a/usr.bin/tput/tput.1 +++ b/usr.bin/tput/tput.1 @@ -1,5 +1,5 @@ '\" t -.\" $OpenBSD: tput.1,v 1.27 2023/10/17 09:52:11 nicm Exp $ +.\" $OpenBSD: tput.1,v 1.28 2024/08/23 15:10:40 nicm Exp $ .\"*************************************************************************** .\" Copyright 2018-2022,2023 Thomas E. Dickey * .\" Copyright 1998-2016,2017 Free Software Foundation, Inc. * @@ -607,9 +607,9 @@ as ncurses. NetBSD curses documents different exit codes which do not correspond to either ncurses or X/Open. .SH SEE ALSO -\fB?\fP(\*n), +\fBclear\fP(\*n), \fBstty\fP(1), -\fB?\fP(\*n), +\fBtabs\fP(\*n), \fBtset\fP(\*n), \fBtermcap\fP(3), \fBterminfo\fP(5). diff --git a/usr.bin/tset/tset.1 b/usr.bin/tset/tset.1 index 9c9b55a20..8d23968bf 100644 --- a/usr.bin/tset/tset.1 +++ b/usr.bin/tset/tset.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tset.1,v 1.25 2023/10/17 09:52:11 nicm Exp $ +.\" $OpenBSD: tset.1,v 1.26 2024/08/23 15:10:40 nicm Exp $ .\" .\"*************************************************************************** .\" Copyright 2018-2022,2023 Thomas E. Dickey * @@ -40,11 +40,11 @@ .el .IP \(bu 2 .. .SH NAME -\fBtset\fP, \fB?\fP \- terminal initialization +\fBtset\fP, \fBreset\fP \- terminal initialization .SH SYNOPSIS \fBtset\fP [\fB\-IQVcqrsw\fP] [\fB\-\fP] [\fB\-e\fP \fIch\fP] [\fB\-i\fP \fIch\fP] [\fB\-k\fP \fIch\fP] [\fB\-m\fP \fImapping\fP] [\fIterminal\fP] .br -\fB?\fP [\fB\-IQVcqrsw\fP] [\fB\-\fP] [\fB\-e\fP \fIch\fP] [\fB\-i\fP \fIch\fP] [\fB\-k\fP \fIch\fP] [\fB\-m\fP \fImapping\fP] [\fIterminal\fP] +\fBreset\fP [\fB\-IQVcqrsw\fP] [\fB\-\fP] [\fB\-e\fP \fIch\fP] [\fB\-i\fP \fIch\fP] [\fB\-k\fP \fIch\fP] [\fB\-m\fP \fImapping\fP] [\fIterminal\fP] .SH DESCRIPTION .SS tset - initialization This program initializes terminals. @@ -118,7 +118,7 @@ Finally, if the erase, interrupt and line kill characters have changed, or are not set to their default values, their values are displayed to the standard error output. .SS reset - reinitialization -When invoked as \fB?\fP, \fBtset\fP sets the terminal +When invoked as \fBreset\fP, \fBtset\fP sets the terminal modes to \*(``sane\*('' values: .bP sets cooked and echo modes, @@ -134,12 +134,12 @@ doing the terminal initialization described above. Also, rather than using the terminal \fIinitialization\fP strings, it uses the terminal \fIreset\fP strings. .PP -The \fB?\fP command is useful +The \fBreset\fP command is useful after a program dies leaving a terminal in an abnormal state: .bP you may have to type .sp - \fI\fB?\fI\fR + \fI\fBreset\fI\fR .sp (the line-feed character is normally control-J) to get the terminal to work, as carriage-return may no longer work in the abnormal state. @@ -313,7 +313,7 @@ S. Raymond . .SH COMPATIBILITY Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7 (POSIX.1-2008) nor -X/Open Curses Issue 7 documents \fBtset\fP or \fB?\fP. +X/Open Curses Issue 7 documents \fBtset\fP or \fBreset\fP. .PP The AT&T \fBtput\fP utility (AIX, HPUX, Solaris) incorporated the terminal-mode manipulation as well as termcap-based features @@ -370,7 +370,7 @@ although it is strongly recommended that such usage be fixed to explicitly specify the character. .PP As of 4.4BSD, -executing \fBtset\fP as \fB?\fP no longer implies the \fB\-Q\fP option. +executing \fBtset\fP as \fBreset\fP no longer implies the \fB\-Q\fP option. Also, the interaction between the \- option and the \fIterminal\fP argument in some historic implementations of \fBtset\fP has been removed. .PP