seq: style(9) cleanup

This is in part for diff reduction with OpenBSD.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2023-06-25 19:33:49 -04:00
parent 47d0c1fe7d
commit 8f8da1bcc7

View File

@ -57,8 +57,7 @@ __FBSDID("$FreeBSD$");
static const char *decimal_point = "."; /* default */
static char default_format[] = { "%g" }; /* default */
static const struct option long_opts[] =
{
static const struct option long_opts[] = {
{"format", required_argument, NULL, 'f'},
{"separator", required_argument, NULL, 's'},
{"terminator", required_argument, NULL, 't'},
@ -106,9 +105,9 @@ main(int argc, char *argv[])
decimal_point = locale->decimal_point;
/*
* Process options, but handle negative numbers separately
* least they trip up getopt(3).
*/
* Process options, but handle negative numbers separately
* least they trip up getopt(3).
*/
while ((optind < argc) && !numeric(argv[optind]) &&
(c = getopt_long(argc, argv, "+f:hs:t:w", long_opts, NULL)) != -1) {
@ -156,7 +155,7 @@ main(int argc, char *argv[])
incr = e_atof(argv[1]);
/* Plan 9/GNU don't do zero */
if (incr == 0.0)
errx(1, "zero %screment", (first < last)? "in" : "de");
errx(1, "zero %screment", (first < last) ? "in" : "de");
}
/* default is one for Plan 9/GNU work alike */
@ -176,7 +175,7 @@ main(int argc, char *argv[])
if (!valid_format(fmt))
errx(1, "invalid format string");
/*
* XXX to be bug for bug compatible with Plan 9 add a
* XXX to be bug for bug compatible with Plan 9 add a
* newline if none found at the end of the format string.
*/
} else
@ -297,18 +296,18 @@ valid_format(const char *fmt)
/* conversion */
switch (*fmt) {
case 'A':
case 'a':
case 'E':
case 'e':
case 'F':
case 'f':
case 'G':
case 'g':
case 'A':
case 'a':
case 'E':
case 'e':
case 'F':
case 'f':
case 'G':
case 'g':
/* floating point formats are accepted */
conversions++;
break;
default:
default:
/* anything else is not */
return 0;
}