[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nmh-workers] Handling empty components
From: |
Ken Hornstein |
Subject: |
Re: [nmh-workers] Handling empty components |
Date: |
Fri, 22 Mar 2019 00:02:47 -0400 |
>Is there a concise way to specify "if X is not present or is just
>white space?" in one's replcomps?
We covered this ground a few years ago, here:
http://lists.nongnu.org/archive/html/nmh-workers/2015-02/msg00139.html
Priescently, I said back then:
>Mind you, a header consisting of nothing but white space will be read
>as "true" in the sense of mh-format(5) tests
And just to be sure:
% fmttest -raw -format '%<(nonnull{text})Non-null%|Null%>' ''
Null
% fmttest -raw -format '%<(nonnull{text})Non-null%|Null%>' ' '
Non-null
But I see:
% fmttest -raw -format '%(trim{text})%<(nonnull)Non-null%|Null%>' ' '
Null
So Ralph was right, %(trim) does what you want. But ... %(trim) does
not have a return value (that was probably a mistake), so you cannot use
it directly as a condition for %<. You'll have to make sure your first
test is against the str register rather than Reply-To, and making it work
for all components is actually going to be a bit messy.
You know, since this the first one you've encountered in 30 years, maybe
it is better just to let it go?
--Ken
- [nmh-workers] Handling empty components, Bob Carragher, 2019/03/20
- Re: [nmh-workers] Handling empty components, Ralph Corderoy, 2019/03/21
- Re: [nmh-workers] Handling empty components,
Ken Hornstein <=
- Re: [nmh-workers] Handling empty components, Bob Carragher, 2019/03/22
- Re: [nmh-workers] Handling empty components, Ken Hornstein, 2019/03/22
- Re: [nmh-workers] Handling empty components, Ken Hornstein, 2019/03/22
- Re: [nmh-workers] Handling empty components, Bob Carragher, 2019/03/23
- Re: [nmh-workers] Handling empty components, Ken Hornstein, 2019/03/23
- Re: [nmh-workers] Handling empty components, Bob Carragher, 2019/03/30
- Re: [nmh-workers] Handling empty components, Ralph Corderoy, 2019/03/30
- Re: [nmh-workers] Handling empty components, Ken Hornstein, 2019/03/30