Commit Graph

12 Commits

Author SHA1 Message Date
cheusov d7beb5fa1a seq.c: replace non-standard `\e` with standard compliant `\x1B` 2021-03-20 22:10:17 +00:00
christos 07ed41e72f - Default terminator to \n
- Don't print a trailing separator
Behavior now matches GNU seq (from Aram at tech-userlevel)
2018-12-17 20:10:51 +00:00
ginsbach 094918e495 The sign is optional in an exponent
Treat numbers after [Ee] as a positive number rather than an invalid
numeric sequence.  (Taken from FreeBSD but done differently.)
2017-10-29 01:28:46 +00:00
ginsbach 81821b805f Fix typos (from FreeBSD) 2017-10-29 00:02:23 +00:00
sevan 39bbc68a3b Drop main() prototype. 2016-09-05 00:40:28 +00:00
dholland d6986f611b Rerun valid_format() both before and after unescaping the format
string, in case the format string contains printf conversions
assembled from escape sequences.

A better approach might be to adjust the unescape logic to avoid
generating printf conversions (e.g. convert \x25 to %% instead of %)
but that's somewhat problematic and it's not really worth taking the
trouble.

Running valid_format() only after unescaping would also be somewhat
tidier but makes printing the invalid format string problematic,
because the unescape logic runs in place.

None of these cases are really worth worrying about in detail, but now
at least they don't result in SIGSEGV.

Related to PR 43355.
2010-05-27 08:40:19 +00:00
dholland 76c7c8ecbf Fix valid_format() to be more careful about allowing only valid printf
formats.

Also, accept %a and %A, which are new since this logic was last updated,
and also allow %F even though it's not functionally different from %f.
Document these additions and bump date of man page.

Fixes PR 43355.
2010-05-27 08:30:35 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
ginsbach 709ba647ca Remove clause 3 and 4 from TNF licenses 2008-04-30 14:22:14 +00:00
ginsbach 9470f2d15c Fix problem with handling escaped octal and hexadecimal sequences in the -f
format option.  The problem is that the next character after such an escape
was not copied to the output.
2008-01-18 16:16:10 +00:00
wiz 704c845e60 Sync usage with man page. 2005-01-20 09:20:03 +00:00
ginsbach e8c2320896 seq(1) - print sequences of numbers 2005-01-20 04:13:42 +00:00