diff --git a/usr.bin/awk/FIXES.1e b/usr.bin/awk/FIXES.1e index 8cbd6ac1a..c35c71d8f 100644 --- a/usr.bin/awk/FIXES.1e +++ b/usr.bin/awk/FIXES.1e @@ -26,13 +26,13 @@ This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August 1987. Sep 06, 2023: - Fix edge case where FS is changed on commandline. Thanks to + Fix edge case where FS is changed on commandline. Thanks to Gordon Shephard and Miguel Pineiro Jr. Fix regular expression clobbering in the lexer, where lexer does not make a copy of regexp literals. also makedfa memory leaks have been plugged. Thanks to Miguel Pineiro Jr. - + Dec 15, 2022: Force hex escapes in strings to be no more than two characters, as they already are in regular expressions. This brings internal @@ -55,7 +55,7 @@ May 23, 2022: Mar 14, 2022: Historic bug: command-line "name=value" assignment had been - truncating its entry in ARGV. (circa 1989) Thanks to + truncating its entry in ARGV. (circa 1989) Thanks to Miguel Pineiro Jr. . Mar 3, 2022: diff --git a/usr.bin/awk/lib.c b/usr.bin/awk/lib.c index 5749a9d5f..fafe32fa6 100644 --- a/usr.bin/awk/lib.c +++ b/usr.bin/awk/lib.c @@ -445,7 +445,7 @@ void fldbld(void) /* create fields from current record */ } if (*r++ == 0) break; - + } } *fr = 0; diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c index d5e32f6f1..be9717b7d 100644 --- a/usr.bin/awk/run.c +++ b/usr.bin/awk/run.c @@ -712,7 +712,7 @@ int u8_byte2char(const char *s, int bytenum) { int i, len, b; int charnum = 0; /* BUG: what origin? */ - /* should be 0 to match start==0 which means no match */ + /* should be 0 to match start==0 which means no match */ b = strlen(s); if (bytenum > b) { @@ -757,13 +757,13 @@ enum }; int runetochar(char *str, int c) -{ - /* one character sequence 00000-0007F => 00-7F */ +{ + /* one character sequence 00000-0007F => 00-7F */ if (c <= Rune1) { str[0] = c; return 1; } - + /* two character sequence 00080-007FF => T2 Tx */ if (c <= Rune2) { str[0] = T2 | (c >> 1*Bitx); @@ -780,14 +780,14 @@ int runetochar(char *str, int c) str[2] = Tx | (c & Maskx); return 3; } - + /* four character sequence 010000-1FFFFF => T4 Tx Tx Tx */ str[0] = T4 | (c >> 3*Bitx); str[1] = Tx | ((c >> 2*Bitx) & Maskx); str[2] = Tx | ((c >> 1*Bitx) & Maskx); str[3] = Tx | (c & Maskx); return 4; -} +} /* ========== end of utf8 code =========== */ @@ -1247,7 +1247,7 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co prec = u8_strlen(t); pad = wid>prec ? wid - prec : 0; // has to be >= 0 int i, k, n; - + if (ljust) { // print prec chars from t, then pad blanks n = u8_char2byte(t, prec); for (k = 0; k < n; k++) { diff --git a/usr.bin/bc/USD.doc/bc b/usr.bin/bc/USD.doc/bc index fc93c5d3a..0400e0183 100644 --- a/usr.bin/bc/USD.doc/bc +++ b/usr.bin/bc/USD.doc/bc @@ -454,7 +454,7 @@ permitted. The names of arrays are permitted to collide with the names of simple variables and function names. Any fractional part of a subscript is discarded before use. -Subscripts must be greater than or equal to zero and +Subscripts must be greater than or equal to zero and less than or equal to 2047. .PP Subscripted variables may be freely used in expressions, in @@ -1053,7 +1053,7 @@ Storage classes .PP There are only two storage classes in BC, global and automatic (local). -Only identifiers that are to be local to a function need be +Only identifiers that are to be local to a function need be declared with the \fBauto\fP command. The arguments to a function are local to the function. @@ -1061,7 +1061,7 @@ All other identifiers are assumed to be global and available to all functions. All identifiers, global and local, have initial values of zero. -Identifiers declared as \fBauto\fP are allocated on entry to the function +Identifiers declared as \fBauto\fP are allocated on entry to the function and released on returning from the function. They therefore do not retain values between function calls. \fBauto\fP arrays are specified by the array name followed by empty square brackets. @@ -1069,7 +1069,7 @@ They therefore do not retain values between function calls. Automatic variables in BC do not work in exactly the same way as in either C or PL/I. On entry to a function, the old values of the names that appear as parameters and as automatic -variables are pushed onto a stack. +variables are pushed onto a stack. Until return is made from the function, reference to these names refers only to the new values. .NH 1 @@ -1203,14 +1203,14 @@ value is printed and assigned to the variable `last'. No trailing newline is printed. The expression may also be a string enclosed in double quotes. Within these strings the following escape sequences may be used: -\ea +\ea for bell (alert), `\eb' for backspace, `\ef' for formfeed, `\en' -for newline, +for newline, `\er' for carriage return, `\et' @@ -1229,7 +1229,7 @@ The \fBquit\fR statement stops execution of a BC program and returns control to UNIX when it is first encountered. Because it is not treated as an executable statement, it cannot be used -in a function definition or in an +in a function definition or in an .ft B if, for, .ft diff --git a/usr.bin/cal/README b/usr.bin/cal/README index 638ac9dff..83051657e 100644 --- a/usr.bin/cal/README +++ b/usr.bin/cal/README @@ -10,13 +10,13 @@ that even if I was dumb enough to try. From this we can easily calculate the day of week for any date. The algorithm for a zero based day of week: calculate the number of days in all prior years (year-1)*365 - add the number of leap years (days?) since year 1 + add the number of leap years (days?) since year 1 (not including this year as that is covered later) add the day number within the year this compensates for the non-inclusive leap year calculation if the day in question occurs before the gregorian reformation - (3 sep 1752 for our purposes), then simply return + (3 sep 1752 for our purposes), then simply return (value so far - 1 + SATURDAY's value of 6) modulo 7. if the day in question occurs during the reformation (3 sep 1752 to 13 sep 1752 inclusive) return THURSDAY. This is my diff --git a/usr.bin/dc/USD.doc/dc b/usr.bin/dc/USD.doc/dc index ff5288fb0..807558a5b 100644 --- a/usr.bin/dc/USD.doc/dc +++ b/usr.bin/dc/USD.doc/dc @@ -502,7 +502,7 @@ exactly as described. The quantity returned is the remains of the dividend at the end of the divide process. Since division truncates toward zero, remainders have the same sign as the dividend. -The scale of the remainder is set to +The scale of the remainder is set to the maximum of the scale of the dividend and the scale of the quotient plus the scale of the divisor. .SH @@ -544,7 +544,7 @@ Input Conversion and Base Numbers are converted to the internal representation as they are read in. The scale stored with a number is simply the number of fractional digits input. -Negative numbers are indicated by preceding the number with a \fB\_\fP (an +Negative numbers are indicated by preceding the number with a \fB\_\fP (an underscore). The hexadecimal digits A\-F correspond to the numbers 10\-15 regardless of input base. The \fBi\fP command can be used to change the base of the input numbers. @@ -653,9 +653,9 @@ into the array \fIx\fP of the value to be loaded. .SH Miscellaneous Commands .PP -The command \fB!\fP interprets the rest of the line as a -.UX -command and passes it to +The command \fB!\fP interprets the rest of the line as a +.UX +command and passes it to .UX to execute. One other compiler command is \fBQ\fP. diff --git a/usr.bin/lex/options.c b/usr.bin/lex/options.c index b0a50b71c..a00e17a03 100644 --- a/usr.bin/lex/options.c +++ b/usr.bin/lex/options.c @@ -32,7 +32,7 @@ /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ - + #include "options.h" /* Be sure to synchronize these options with those defined in "options.h", diff --git a/usr.bin/lex/scanopt.c b/usr.bin/lex/scanopt.c index b588f2eba..3d0f77a47 100644 --- a/usr.bin/lex/scanopt.c +++ b/usr.bin/lex/scanopt.c @@ -32,7 +32,7 @@ /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ - + #include "flexdef.h" #include "scanopt.h" diff --git a/usr.bin/libtool/LT/Mode/Link/Library.pm b/usr.bin/libtool/LT/Mode/Link/Library.pm index a6967c817..14daf5ade 100644 --- a/usr.bin/libtool/LT/Mode/Link/Library.pm +++ b/usr.bin/libtool/LT/Mode/Link/Library.pm @@ -127,7 +127,7 @@ sub link my @libobjects = values %$libs; tsay {"libs:\n", join("\n", (keys %$libs))}; - tsay {"libfiles:\n", + tsay {"libfiles:\n", join("\n", map { $_->{fullpath}//'UNDEF' } @libobjects) }; $linker->create_symlinks($symlinkdir, $libs); diff --git a/usr.bin/m4/look.c b/usr.bin/m4/look.c index 134e11bf4..72db8fc78 100644 --- a/usr.bin/m4/look.c +++ b/usr.bin/m4/look.c @@ -293,7 +293,7 @@ keep(char *ptr) else kept_capacity = 50; kept = xreallocarray(kept, kept_capacity, - sizeof(char *), "Out of memory while saving %d strings\n", + sizeof(char *), "Out of memory while saving %d strings\n", kept_capacity); } kept[kept_size++] = ptr; diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 7577b15f8..61f03afe1 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -488,7 +488,7 @@ add_targets_to_make(Lst todo) if (gn->children_left != 0) { if (DEBUG(MAKE)) printf("%s: not queuing (%d child%s left to build)\n", - gn->name, gn->children_left, + gn->name, gn->children_left, gn->children_left > 1 ? "ren" : ""); Lst_ForEach(&gn->children, MakeAddChild, &examine); diff --git a/usr.bin/rdist/client.c b/usr.bin/rdist/client.c index 392ca3f5d..98d377d27 100644 --- a/usr.bin/rdist/client.c +++ b/usr.bin/rdist/client.c @@ -523,7 +523,7 @@ rmchk(opt_t opts) } (void) snprintf(ptarget, sizeof(target) - (ptarget - target), - "%s%s", + "%s%s", (ptarget[-1] == '/' ? "" : "/"), targ); debugmsg(DM_MISC, "check %s\n", target); diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c index eb1db5227..794322ced 100644 --- a/usr.bin/rdist/common.c +++ b/usr.bin/rdist/common.c @@ -270,7 +270,7 @@ sendcmdmsg(int cmd, char *msg, size_t msgsize) } debugmsg(DM_PROTO, ">>> Cmd = %c (\\%3.3o) Msg = \"%.*s\"", - cmd, cmd, + cmd, cmd, (cmd == C_NONE) ? len-1 : len-2, (cmd == C_NONE) ? msg : msg + 1); diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 72c5523a1..af425d97c 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -123,7 +123,7 @@ print_header(void) "%s (%u-%u of %u) %s", uloadbuf, start, end, num_disp, paused ? "PAUSED" : ""); else - snprintf(tmpbuf, sizeof(tmpbuf), + snprintf(tmpbuf, sizeof(tmpbuf), "%s %s", uloadbuf, paused ? "PAUSED" : "");