[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] switches and smatch
From: |
Ralph Corderoy |
Subject: |
Re: [Nmh-workers] switches and smatch |
Date: |
Sat, 27 Jan 2018 14:16:44 +0000 |
Hi David,
> Agreed, this needs a good cleaning.
I'd like to see a lot of the noddy `-foo sets bool foo, -nofoo clears
it'-case processing in a switch disappear into a central, new,
option-processing routine.
> > $ post '-sasl -user' -foobar
> > seen -sasl
> > post: -foobar unknown
> > $
>
> I'd say it's more pilot error. If we could catch and deal with it
> robustly, great, but if not, OK.
It can come about in a script when options are being built up in a
variable and «"$opt"» is used to pass them with erroneous quotes out of
habit. It silently works when $opt only has -foo xor -bar, it silently
half works when it has both and may go unnoticed for a while.
We could definitely catch it since `-sasl' takes no parameter and thus
the problem is smatch() taking the following space, and the definition's
end, as a match. Presumably, smatch() is called with a string from a
file and it's intended the caller moves on by strlen("-sasl"), skips
blanks, and calls smatch() again. If I'm right, then it's wrongly
been coerced into two roles rather than being told which it should do as
a parameter, or better still, force the caller to terminate the word
being passed in so it's just like an argv[n].
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
- Re: [Nmh-workers] rcvdist with non-default port, (continued)
- Re: [Nmh-workers] rcvdist with non-default port, Ken Hornstein, 2018/01/28
- Re: [Nmh-workers] rcvdist with non-default port, David Levine, 2018/01/15
- Re: [Nmh-workers] rcvdist with non-default port, Ken Hornstein, 2018/01/15
- Re: [Nmh-workers] rcvdist with non-default port, David Levine, 2018/01/15
- Re: [Nmh-workers] rcvdist with non-default port, Ken Hornstein, 2018/01/15
- Re: [Nmh-workers] rcvdist with non-default port, David Levine, 2018/01/15
- Re: [Nmh-workers] rcvdist with non-default port, Steven Winikoff, 2018/01/15
- Re: [Nmh-workers] rcvdist with non-default port, David Levine, 2018/01/15
- Re: [Nmh-workers] rcvdist with non-default port, Ralph Corderoy, 2018/01/27
- Re: [Nmh-workers] switches and smatch, David Levine, 2018/01/27
- Re: [Nmh-workers] switches and smatch,
Ralph Corderoy <=
- Re: [Nmh-workers] switches and smatch, Ken Hornstein, 2018/01/28
- Re: [Nmh-workers] switches and smatch, Paul Vixie, 2018/01/28
- Re: [Nmh-workers] switches and smatch, Ken Hornstein, 2018/01/28
- Re: [Nmh-workers] switches and smatch, Ralph Corderoy, 2018/01/29
- Re: [Nmh-workers] switches and smatch, Bakul Shah, 2018/01/29
- Re: [Nmh-workers] switches and smatch, Ken Hornstein, 2018/01/29
- Re: [Nmh-workers] switches and smatch, Ralph Corderoy, 2018/01/30
- Re: [Nmh-workers] switches and smatch, Bakul Shah, 2018/01/30
- Re: [Nmh-workers] rcvdist with non-default port, David Levine, 2018/01/14
- Re: [Nmh-workers] rcvdist with non-default port, Ralph Corderoy, 2018/01/18