diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/bmake/Makefile.config | 2 | ||||
-rw-r--r-- | usr.bin/diff/diffreg.c | 3 | ||||
-rw-r--r-- | usr.bin/diff/diffreg_new.c | 4 | ||||
-rwxr-xr-x | usr.bin/diff/tests/diff_test.sh | 10 | ||||
-rw-r--r-- | usr.bin/expand/expand.1 | 8 | ||||
-rw-r--r-- | usr.bin/fortune/datfiles/freebsd-tips | 11 | ||||
-rw-r--r-- | usr.bin/grdc/grdc.6 | 19 | ||||
-rw-r--r-- | usr.bin/grdc/grdc.c | 83 | ||||
-rw-r--r-- | usr.bin/lsvfs/lsvfs.1 | 2 | ||||
-rwxr-xr-x | usr.bin/man/man.sh | 4 | ||||
-rw-r--r-- | usr.bin/netstat/inet.c | 8 | ||||
-rw-r--r-- | usr.bin/netstat/nhops.c | 5 | ||||
-rw-r--r-- | usr.bin/netstat/route.c | 5 | ||||
-rw-r--r-- | usr.bin/posixmqcontrol/posixmqcontrol.1 | 2 |
14 files changed, 121 insertions, 45 deletions
diff --git a/usr.bin/bmake/Makefile.config b/usr.bin/bmake/Makefile.config index ee717d952846..55bc4a4370ca 100644 --- a/usr.bin/bmake/Makefile.config +++ b/usr.bin/bmake/Makefile.config @@ -6,7 +6,7 @@ SRCTOP?= ${.CURDIR:H:H} # things set by configure -_MAKE_VERSION?=20240430 +_MAKE_VERSION?=20240508 prefix?= /usr srcdir= ${SRCTOP}/contrib/bmake diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 06d914215b11..6073feebf5fb 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -408,7 +408,8 @@ diffreg_stone(char *file1, char *file2, int flags, int capsicum) } if (diff_format == D_BRIEF && ignore_pats == NULL && - (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|D_STRIPCR)) == 0) + (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE| + D_SKIPBLANKLINES|D_STRIPCR)) == 0) { rval = D_DIFFER; status |= 1; diff --git a/usr.bin/diff/diffreg_new.c b/usr.bin/diff/diffreg_new.c index 3b50dfd5940b..a7a40ec12ec9 100644 --- a/usr.bin/diff/diffreg_new.c +++ b/usr.bin/diff/diffreg_new.c @@ -218,10 +218,14 @@ diffreg_new(char *file1, char *file2, int flags, int capsicum) rc = D_ERROR; goto done; } + if (left.atomizer_flags & DIFF_ATOMIZER_FILE_TRUNCATED) + warnx("%s truncated", file1); if (diff_atomize_file(&right, cfg, f2, (uint8_t *)str2, st2.st_size, diff_flags)) { rc = D_ERROR; goto done; } + if (right.atomizer_flags & DIFF_ATOMIZER_FILE_TRUNCATED) + warnx("%s truncated", file2); result = diff_main(cfg, &left, &right); if (result->rc != DIFF_RC_OK) { diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 146c23fa303d..ab731fa32d26 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -11,6 +11,7 @@ atf_test_case brief_format atf_test_case b230049 atf_test_case stripcr_o atf_test_case b252515 +atf_test_case b278988 atf_test_case Bflag atf_test_case Nflag atf_test_case tabsize @@ -89,6 +90,14 @@ b252515_body() diff -qw b252515_a.in b252515_b.in } +b278988_body() +{ + printf 'a\nb\nn' > b278988.a.in + printf 'a\n\nb\nn' > b278988.b.in + atf_check -o empty -s eq:0 \ + diff -Bw b278988.a.in b278988.b.in +} + header_body() { export TZ=UTC @@ -369,6 +378,7 @@ atf_init_test_cases() atf_add_test_case b230049 atf_add_test_case stripcr_o atf_add_test_case b252515 + atf_add_test_case b278988 atf_add_test_case Bflag atf_add_test_case Nflag atf_add_test_case tabsize diff --git a/usr.bin/expand/expand.1 b/usr.bin/expand/expand.1 index e63d9d7c1e03..68a7a57eb77e 100644 --- a/usr.bin/expand/expand.1 +++ b/usr.bin/expand/expand.1 @@ -78,9 +78,15 @@ If the .Fl a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. -.It Fl t Ar tab1 , tab2 , ... , tabn +.It Fl t Xo +.Sm off +.Ar tab1 , tab2 , ... , tabn +.Sm on +.Xc Set tab stops at column positions +.Sm off .Ar tab1 , tab2 , ... , tabn . +.Sm on If only a single number is given, tab stops are set that number of column positions apart instead of the default number of 8. .El diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index 028a9e9b1430..c0807405005e 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -845,3 +845,14 @@ kern.tty_info_kstacks to 0 (off), 1 (on), or 2 (verbose), e.g.: -- Michael Gmelin <grembo@FreeBSD.org> % +To determine which fonts provide a particular Unicode character, fc-list from +the fontconfig package may be helpful. For example, if your friend complains +that the emoji you sent won't display, run fc-list with the hex value of the +character to determine which font your friend should install. + +$ fc-list ':charset=0x1F4A1' +/usr/local/share/fonts/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular + +$ pkg which /usr/local/share/fonts/noto/NotoColorEmoji.ttf +/usr/local/share/fonts/noto/NotoColorEmoji.ttf was installed by package noto-emoji-2.042 +% diff --git a/usr.bin/grdc/grdc.6 b/usr.bin/grdc/grdc.6 index 3c9660055e2b..7420c8ecbe8b 100644 --- a/usr.bin/grdc/grdc.6 +++ b/usr.bin/grdc/grdc.6 @@ -1,4 +1,4 @@ -.Dd September 25, 2001 +.Dd January 15, 2023 .Dt GRDC 6 .Os .Sh NAME @@ -8,6 +8,9 @@ .Nm .Op Fl st .Op Ar n +.Nm +.Fl c +.Ar n .Sh DESCRIPTION .Nm runs a digital clock made of reverse-video blanks on a curses @@ -17,6 +20,11 @@ With an optional numeric argument it stops after .Ar n seconds (default never). +The clock can act as a countdown timer with the +.Fl c +flag, +.Ar n +specifies the number of seconds to time for. The optional .Fl s flag makes digits scroll as they change. @@ -37,8 +45,17 @@ for more information. If this variable is not set, the time zone is determined based on .Pa /etc/localtime . .El +.Sh NOTES +In countdown timer mode, the specifying of +.Fl n +> 360000 seconds (100 hours) will lead to the counter displaying +incorrect remaining time, however it will time correctly, and +display correctly when the remaining time becomes less than +100 hours. .Sh AUTHORS .An -nosplit .An Amos Shapir , modified for curses by .An John Lupien . +Countdown timer mode by +.An Gavin Atkinson . diff --git a/usr.bin/grdc/grdc.c b/usr.bin/grdc/grdc.c index e2a694ebc461..07d12f5a7fb0 100644 --- a/usr.bin/grdc/grdc.c +++ b/usr.bin/grdc/grdc.c @@ -1,12 +1,15 @@ /* * Grand digital clock for curses compatible terminals * Usage: grdc [-st] [n] -- run for n seconds (default infinity) - * Flags: -s: scroll + * grdc -c n -- countdown n seconds + * Flags: -c: Countdown timer mode + * -s: scroll * -t: output time in 12-hour format * * * modified 10-18-89 for curses (jrl) * 10-18-89 added signal handling + * 02-18-02 added countdown timer mode * * modified 03-25-03 for 12 hour option * - Samy Al Bahra <samy@kerneled.com> @@ -26,6 +29,7 @@ static struct timespec now; static struct tm *tm; +static struct timespec end; static short disp[11] = { 075557, 011111, 071747, 071717, 055711, @@ -59,18 +63,19 @@ main(int argc, char *argv[]) int i, j, s, k; int n; int ch; - int scrol; - int t12; + bool scrol = false, t12 = false, timer = false; + int hour, minute, second; - t12 = scrol = 0; - - while ((ch = getopt(argc, argv, "ts")) != -1) + while ((ch = getopt(argc, argv, "cst")) != -1) switch (ch) { + case 'c': + timer = true; + break; case 's': - scrol = 1; + scrol = true; break; case 't': - t12 = 1; + t12 = true; break; case '?': default: @@ -80,7 +85,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc > 1) { + if ((argc > 1) || (argc == 0 && timer)) { usage(); /* NOTREACHED */ } @@ -95,6 +100,9 @@ main(int argc, char *argv[]) } else n = 0; + if (timer && n == 0) + return(0); + initscr(); signal(SIGINT,sighndl); @@ -107,7 +115,7 @@ main(int argc, char *argv[]) hascolor = has_colors(); - if(hascolor) { + if (hascolor) { start_color(); init_pair(1, COLOR_BLACK, COLOR_RED); init_pair(2, COLOR_RED, COLOR_BLACK); @@ -118,7 +126,7 @@ main(int argc, char *argv[]) clear(); refresh(); - if(hascolor) { + if (hascolor) { attrset(COLOR_PAIR(3)); mvaddch(YBASE - 2, XBASE - 3, ACS_ULCORNER); @@ -139,28 +147,42 @@ main(int argc, char *argv[]) } clock_gettime(CLOCK_REALTIME_FAST, &now); prev_sec = now.tv_sec; + if (timer) { + end = now; + end.tv_sec += n; + } do { mask = 0; - tm = localtime(&now.tv_sec); - set(tm->tm_sec%10, 0); - set(tm->tm_sec/10, 4); - set(tm->tm_min%10, 10); - set(tm->tm_min/10, 14); - - if (t12) { - if (tm->tm_hour < 12) { - if (tm->tm_hour == 0) - tm->tm_hour = 12; - mvaddstr(YBASE + 5, XBASE + 52, "AM"); - } else { - if (tm->tm_hour > 12) - tm->tm_hour -= 12; - mvaddstr(YBASE + 5, XBASE + 52, "PM"); + if (!timer) { + tm = localtime(&now.tv_sec); + if (t12) { + if (tm->tm_hour < 12) { + if (tm->tm_hour == 0) + tm->tm_hour = 12; + mvaddstr(YBASE + 5, XBASE + 52, "AM"); + } else { + if (tm->tm_hour > 12) + tm->tm_hour -= 12; + mvaddstr(YBASE + 5, XBASE + 52, "PM"); + } } + hour = tm->tm_hour; + minute = tm->tm_min; + second = tm->tm_sec; + } else { + n = end.tv_sec - now.tv_sec; + if (n <= 0) + break; + hour = (n / 3600) % 100; + minute = (n / 60) % 60; + second = n % 60; } - - set(tm->tm_hour%10, 20); - set(tm->tm_hour/10, 24); + set(second % 10, 0); + set(second / 10, 4); + set(minute % 10, 10); + set(minute / 10, 14); + set(hour % 10, 20); + set(hour / 10, 24); set(10, 7); set(10, 17); for(k=0; k<6; k++) { @@ -266,6 +288,7 @@ static void usage(void) { - (void)fprintf(stderr, "usage: grdc [-st] [n]\n"); + (void)fprintf(stderr, "usage: grdc [-st] [n]\n" + " grdc -c n\n"); exit(1); } diff --git a/usr.bin/lsvfs/lsvfs.1 b/usr.bin/lsvfs/lsvfs.1 index 082023f00857..9871df32fa96 100644 --- a/usr.bin/lsvfs/lsvfs.1 +++ b/usr.bin/lsvfs/lsvfs.1 @@ -47,7 +47,7 @@ flag bits. Show information about the .Ql ufs and -.Xr devfs 5 +.Xr devfs 4 filesystems and check the number of mounts for the former: .Bd -literal -offset indent $ lsvfs ufs devfs diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 03803b777463..af638527f497 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -201,6 +201,10 @@ decho() { # Returns true if glob resolves to a real file and store the first # found filename in the variable $found exists() { + if [ -z "$1" ]; then + return 1 + fi + local IFS # Don't accidentally inherit callers IFS (breaks perl manpages) diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 0657926eab80..5d7fd0e46cf1 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -783,11 +783,13 @@ tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) p(tcps_sack_recovery_episode, "\t{:recovery-episodes/%ju} " "{N:/SACK recovery episode%s}\n"); - p(tcps_sack_rexmits, "\t{:segment-retransmits/%ju} " + p(tcps_sack_rexmits, "\t{:segment-retransmits/%ju} " "{N:/segment rexmit%s in SACK recovery episodes}\n"); - p(tcps_sack_rexmit_bytes, "\t{:byte-retransmits/%ju} " + p(tcps_sack_rexmits_tso, "\t{:tso-chunk-retransmits/%ju} " + "{N:/tso chunk rexmit%s in SACK recovery episodes}\n"); + p(tcps_sack_rexmit_bytes, "\t{:byte-retransmits/%ju} " "{N:/byte rexmit%s in SACK recovery episodes}\n"); - p(tcps_sack_rcv_blocks, "\t{:received-blocks/%ju} " + p(tcps_sack_rcv_blocks, "\t{:received-blocks/%ju} " "{N:/SACK option%s (SACK blocks) received}\n"); p(tcps_sack_send_blocks, "\t{:sent-option-blocks/%ju} " "{N:/SACK option%s (SACK blocks) sent}\n"); diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index f4c76f54a420..1a5d8eee74b1 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -64,16 +64,15 @@ #include "common.h" /* column widths; each followed by one space */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ static int wid_dst; static int wid_gw; @@ -415,7 +414,7 @@ print_nhops_sysctl(int fibnum, int af) wid_flags = 6; wid_pksent = 8; wid_mtu = 6; - wid_if = WID_IF_DEFAULT(fam); + wid_if = WID_IF_DEFAULT; xo_open_instance("rt-family"); pr_family(fam); xo_open_list("nh-entry"); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 6152cbdc859f..482fb07ff950 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -184,16 +184,15 @@ pr_family(int af1) } /* column widths; each followed by one space */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ struct _wid wid; @@ -234,7 +233,7 @@ set_wid(int fam) wid.flags = 6; wid.pksent = 8; wid.mtu = 6; - wid.iface = WID_IF_DEFAULT(fam); + wid.iface = WID_IF_DEFAULT; wid.expire = 6; } diff --git a/usr.bin/posixmqcontrol/posixmqcontrol.1 b/usr.bin/posixmqcontrol/posixmqcontrol.1 index ec60230aac6e..67ddbfd5eaf0 100644 --- a/usr.bin/posixmqcontrol/posixmqcontrol.1 +++ b/usr.bin/posixmqcontrol/posixmqcontrol.1 @@ -164,7 +164,7 @@ use the command .Xr mq_send 2 , .Xr mq_setattr 2 , .Xr mq_unlink 2 , -.Xr mqueuefs 5 +.Xr mqueuefs 4 .Sh BUGS mq_timedsend and mq_timedrecv are not implemented. info reports a worst-case estimate for QSIZE. |