diff options
-rw-r--r-- | src/usr.bin/calendar/calendars/calendar.music | 3 | ||||
-rw-r--r-- | src/usr.bin/jot/jot.1 | 26 | ||||
-rw-r--r-- | src/usr.bin/jot/jot.c | 59 | ||||
-rw-r--r-- | src/usr.bin/signify/signify.1 | 8 |
4 files changed, 55 insertions, 41 deletions
diff --git a/src/usr.bin/calendar/calendars/calendar.music b/src/usr.bin/calendar/calendars/calendar.music index b6e7e9c..be92720 100644 --- a/src/usr.bin/calendar/calendars/calendar.music +++ b/src/usr.bin/calendar/calendars/calendar.music @@ -1,7 +1,7 @@ /* * Music * - * $OpenBSD: calendar.music,v 1.40 2021/01/08 23:31:48 jmc Exp $ + * $OpenBSD: calendar.music,v 1.41 2021/08/29 21:10:31 sthen Exp $ */ #ifndef _calendar_music_ @@ -353,6 +353,7 @@ 08/26 Ralph Vaughan Williams dies, 1958 08/27 Josquin Des Prez dies in Conde, 1521 08/29 Michael Joseph Jackson is born in Gary, Indiana, 1958 +08/29 Lee "Scratch" Perry OD, dub pioneer, dies in Jamaica, 2021 09/01 Engelbert Humperdinck is born in Siegburg, Germany, 1854 09/04 Edvard Grieg dies in Bergen, Norway, 1907 09/04 Anton Bruckner is born in Ansfelden, Austria, 1824 diff --git a/src/usr.bin/jot/jot.1 b/src/usr.bin/jot/jot.1 index c82553e..69c7c64 100644 --- a/src/usr.bin/jot/jot.1 +++ b/src/usr.bin/jot/jot.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: jot.1,v 1.23 2016/08/12 21:49:31 tb Exp $ +.\" $OpenBSD: jot.1,v 1.25 2021/08/13 11:27:33 martijn Exp $ .\" $NetBSD: jot.1,v 1.2 1994/11/14 20:27:36 jtc Exp $ .\" .\" Copyright (c) 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)jot.1 8.1 (Berkeley) 6/6/93 .\" -.Dd $Mdocdate: August 12 2016 $ +.Dd $Mdocdate: August 13 2021 $ .Dt JOT 1 .Os .Sh NAME @@ -45,7 +45,7 @@ .Op Fl s Ar string .Op Fl w Ar word .Oo Ar reps Oo Ar begin Oo Ar end -.Oo Ar s Oc Oc Oc Oc +.Oo Ar step Oc Oc Oc Oc .Ek .Sh DESCRIPTION .Nm @@ -58,9 +58,18 @@ The options are as follows: Just print .Ar word repetitively. +Overrides earlier +.Fl b , +.Fl c , +and +.Fl w . .It Fl c This is an abbreviation for .Fl w Ic %c . +Overrides earlier +.Fl b +and +.Fl w . .It Fl n Do not print the final newline normally appended to the output. .It Fl p Ar precision @@ -99,6 +108,11 @@ are possible by using the appropriate conversion specification inside .Ar word , in which case the data is inserted rather than appended. +Overrides earlier +.Fl b , +.Fl c , +and +.Fl w . .El .Pp The last four arguments specify the length of the output sequence, @@ -115,7 +129,7 @@ The default values for .Ar begin , .Ar end , and -.Ar s +.Ar step are 100, 1, 100, and 1, respectively. Omitted values are computed if possible or assume the default. A special case arises if only @@ -128,7 +142,7 @@ if is greater than .Ar end then -.Ar s +.Ar step is set to \(mi1, otherwise it is set to 1; afterwards .Ar reps @@ -149,7 +163,7 @@ Random numbers are obtained through Historical versions of .Nm used -.Ar s +.Ar step to seed the random number generator. This is no longer supported. The name diff --git a/src/usr.bin/jot/jot.c b/src/usr.bin/jot/jot.c index b2e4a05..a0b3de8 100644 --- a/src/usr.bin/jot/jot.c +++ b/src/usr.bin/jot/jot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: jot.c,v 1.49 2019/06/27 18:03:36 deraadt Exp $ */ +/* $OpenBSD: jot.c,v 1.56 2021/08/13 12:37:28 jmc Exp $ */ /* $NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $ */ /*- @@ -70,6 +70,7 @@ static bool intdata; static bool longdata; static bool nosign; static bool randomize; +static bool word; static void getformat(void); static int getprec(char *); @@ -94,10 +95,13 @@ main(int argc, char *argv[]) switch (ch) { case 'b': boring = true; + chardata = word = false; format = optarg; break; case 'c': chardata = true; + boring = word = false; + format = ""; break; case 'n': finalnl = false; @@ -115,6 +119,8 @@ main(int argc, char *argv[]) sepstring = optarg; break; case 'w': + word = true; + boring = chardata = false; format = optarg; break; default: @@ -160,8 +166,6 @@ main(int argc, char *argv[]) mask |= REPS; if (reps == 0) infinity = true; - if (prec == -1) - prec = 0; } case 0: if (prec == -1) @@ -246,7 +250,7 @@ main(int argc, char *argv[]) if (putdata(x, reps == i && !infinity)) errx(1, "range error in conversion: %f", x); } else { /* Random output: use defaults for omitted values. */ - bool use_unif; + bool use_unif = 0; uint32_t pow10 = 1; uint32_t uintx = 0; /* Initialized to make gcc happy. */ @@ -260,21 +264,20 @@ main(int argc, char *argv[]) } x = ender - begin; - if (prec == 0 && (fmod(ender, 1) != 0 || fmod(begin, 1) != 0)) - use_unif = 0; - else { + if (prec > 0 || (fmod(ender, 1) == 0 && fmod(begin, 1) == 0)) { + double range; + while (prec-- > 0) pow10 *= 10; - /* - * If pow10 * (ender - begin) is an integer, use - * arc4random_uniform(). - */ - use_unif = fmod(pow10 * (ender - begin), 1) == 0; - if (use_unif) { - uintx = pow10 * (ender - begin); - if (uintx >= UINT32_MAX) + + range = pow10 * (ender - begin); + + /* If range is an integer, use arc4random_uniform(). */ + if (fmod(range, 1) == 0) { + if (range >= UINT32_MAX) errx(1, "requested range too large"); - uintx++; + use_unif = 1; + uintx = range + 1; } } @@ -305,25 +308,21 @@ putdata(double x, bool last) if (boring) printf("%s", format); else if (longdata && nosign) { - if (x <= (double)ULONG_MAX && x >= 0.0) - printf(format, (unsigned long)x); - else + if (x < 0.0 || x > (double)ULONG_MAX) return 1; + printf(format, (unsigned long)x); } else if (longdata) { - if (x <= (double)LONG_MAX && x >= (double)LONG_MIN) - printf(format, (long)x); - else + if (x < (double)LONG_MIN || x > (double)LONG_MAX) return 1; + printf(format, (long)x); } else if (chardata || (intdata && !nosign)) { - if (x <= (double)INT_MAX && x >= (double)INT_MIN) - printf(format, (int)x); - else + if (x < (double)INT_MIN || x > (double)INT_MAX) return 1; + printf(format, (int)x); } else if (intdata) { - if (x <= (double)UINT_MAX && x >= 0.0) - printf(format, (unsigned int)x); - else + if (x < 0.0 || x > (double)UINT_MAX) return 1; + printf(format, (unsigned int)x); } else printf(format, x); if (!last) @@ -337,7 +336,7 @@ usage(void) { (void)fprintf(stderr, "usage: jot [-cnr] [-b word] [-p precision] " "[-s string] [-w word]\n" - " [reps [begin [end [s]]]]\n"); + " [reps [begin [end [step]]]]\n"); exit(1); } @@ -444,7 +443,7 @@ fmt_broken: while ((p = strchr(p, '%')) != NULL && p[1] == '%') p += 2; - + if (p != NULL) { if (p[1] != '\0') errx(1, "too many conversions"); diff --git a/src/usr.bin/signify/signify.1 b/src/usr.bin/signify/signify.1 index a731b4a..3dcd55d 100644 --- a/src/usr.bin/signify/signify.1 +++ b/src/usr.bin/signify/signify.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: signify.1,v 1.51 2020/08/31 16:08:28 deraadt Exp $ +.\" $OpenBSD: signify.1,v 1.53 2021/09/19 20:58:28 benno Exp $ .\" .\"Copyright (c) 2013 Marc Espie <espie@openbsd.org> .\"Copyright (c) 2013 Ted Unangst <tedu@openbsd.org> @@ -14,7 +14,7 @@ .\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd $Mdocdate: August 31 2020 $ +.Dd $Mdocdate: September 19 2021 $ .Dt SIGNIFY 1 .Os .Sh NAME @@ -171,12 +171,12 @@ Verify a release directory containing .Pa SHA256.sig and a full set of release files: .Bd -literal -offset indent -compact -$ signify -C -p /etc/signify/openbsd-69-base.pub -x SHA256.sig +$ signify -C -p /etc/signify/openbsd-71-base.pub -x SHA256.sig .Ed .Pp Verify a bsd.rd before an upgrade: .Bd -literal -offset indent -compact -$ signify -C -p /etc/signify/openbsd-69-base.pub -x SHA256.sig bsd.rd +$ signify -C -p /etc/signify/openbsd-71-base.pub -x SHA256.sig bsd.rd .Ed .Pp Sign a gzip archive: |