Subject: Re: Re: [PATCH] Improve quality of format-checking code for seq.

From: User <[email-masked]>
Date: Fri, 8 Mar 2024 14:29:45 +0200

Jim Meyering <[email-masked]> wrote:

> Paul Eggert <[email-masked]> wrote:
> > * src/seq.c (validate_format): Remove. Migrate its checks into...
> > (long_double_format): Report an error and exit if an error is found,
> > instead of returning NULL.  All callers changed.
> > Use a more-consistent format for diagnostics.
> > * tests/misc/seq: Adjust to the more-consistent format for diagnostics.
> > ---
> >  src/seq.c      |   71 
> +++++++++++++++----------------------------------------
> >  tests/misc/seq |   10 ++++----
> >  2 files changed, 25 insertions(+), 56 deletions(-)
>
> Thanks.
> As far as I can see this is a "no semantic change"
> patch (modulo diagnostics), and it looks fine, so I pushed it.

Dear Paul Eggert and Jim Meyering,

Thank you very much for the contribution and care! I hope you have 
awesome and cozy day!

It is a nice addition to check the format in the most and explicitly 
safe cases, I believe, however it disallows to use it in cases when you 
need to just repeat a character without ANY processing directive! For 
example, `a=10; seq -f 'x' -s '' -- "$a";` would print 10 characters "x" 
without the check added prior and significantly (or little but still) 
support development in long codes which would require explicit loops or 
additional dependencies like awesome Perl.

Is it possible to reconsider the check or add an option to ignore the 
format which does not have a required directive? If you know a better 
alternative to the standard utility which would result in the same small 
code but great result, please suggest if possible!

Again, appreciated, and please stay safe!

Best and kind regards,

Artfaith