=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/seq/seq.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/seq/seq.c 2022/02/22 23:25:44 1.5 --- src/usr.bin/seq/seq.c 2022/02/25 16:00:39 1.6 *************** *** 1,4 **** ! /* $OpenBSD: seq.c,v 1.5 2022/02/22 23:25:44 tb Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. --- 1,4 ---- ! /* $OpenBSD: seq.c,v 1.6 2022/02/25 16:00:39 tb Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. *************** *** 54,61 **** static const char *decimal_point = "."; /* default */ static char default_format[] = { "%g" }; /* default */ ! static const struct option long_opts[] = ! { {"format", required_argument, NULL, 'f'}, {"help", no_argument, NULL, 'h'}, {"separator", required_argument, NULL, 's'}, --- 54,60 ---- static const char *decimal_point = "."; /* default */ static char default_format[] = { "%g" }; /* default */ ! static const struct option long_opts[] = { {"format", required_argument, NULL, 'f'}, {"help", no_argument, NULL, 'h'}, {"separator", required_argument, NULL, 's'}, *************** *** 154,160 **** incr = e_atof(argv[1]); /* Plan 9/GNU don't do zero */ if (incr == 0.0) ! errx(1, "zero %screment", (first < last)? "in" : "de"); } /* default is one for Plan 9/GNU work alike */ --- 153,159 ---- incr = e_atof(argv[1]); /* Plan 9/GNU don't do zero */ if (incr == 0.0) ! errx(1, "zero %screment", (first < last) ? "in" : "de"); } /* default is one for Plan 9/GNU work alike */ *************** *** 180,186 **** for (step = 1, cur = first; incr > 0 ? cur <= last : cur >= last; cur = first + incr * step++) { if (cur != first) ! fputs(sep, stdout); printf(fmt, cur); last_shown_value = cur; } --- 179,185 ---- for (step = 1, cur = first; incr > 0 ? cur <= last : cur >= last; cur = first + incr * step++) { if (cur != first) ! fputs(sep, stdout); printf(fmt, cur); last_shown_value = cur; } *************** *** 200,206 **** err(1, "asprintf"); if (strcmp(cur_print, last_print) == 0 && cur != last_shown_value) { if (cur != first) ! fputs(sep, stdout); fputs(last_print, stdout); } free(cur_print); --- 199,205 ---- err(1, "asprintf"); if (strcmp(cur_print, last_print) == 0 && cur != last_shown_value) { if (cur != first) ! fputs(sep, stdout); fputs(last_print, stdout); } free(cur_print); *************** *** 290,307 **** /* conversion */ switch (*fmt) { ! case 'A': ! case 'a': ! case 'E': ! case 'e': ! case 'F': ! case 'f': ! case 'G': ! case 'g': /* floating point formats are accepted */ conversions++; break; ! default: /* anything else is not */ return 0; } --- 289,306 ---- /* conversion */ switch (*fmt) { ! case 'A': ! case 'a': ! case 'E': ! case 'e': ! case 'F': ! case 'f': ! case 'G': ! case 'g': /* floating point formats are accepted */ conversions++; break; ! default: /* anything else is not */ return 0; } *************** *** 401,407 **** /* XXX if incr is floating point fix the precision */ if (precision) { snprintf(buf, sizeof(buf), "%%%c%d.%d%c", pad, ! MAXIMUM(width1, width2) + (int) strlen(decimal_point) + precision, precision, (cc) ? cc : 'f'); } else { snprintf(buf, sizeof(buf), "%%%c%d%c", pad, --- 400,406 ---- /* XXX if incr is floating point fix the precision */ if (precision) { snprintf(buf, sizeof(buf), "%%%c%d.%d%c", pad, ! MAXIMUM(width1, width2) + (int)strlen(decimal_point) + precision, precision, (cc) ? cc : 'f'); } else { snprintf(buf, sizeof(buf), "%%%c%d%c", pad,