diff options
author | Nojus Gudinavičius <nojus.gudinavicius@gmail.com> | 2023-07-13 16:14:48 +0300 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-07-14 23:07:10 +0200 |
commit | 21cc3ce129b716f14b229b34dde64026b1f7549f (patch) | |
tree | f21dcd64c5ddf22a2b5027bd7d322aee7a2caa14 /config/compose.go | |
parent | 3a73ffb40ed1ddcb3ab3425ca79e12fca02949be (diff) | |
download | aerc-21cc3ce129b716f14b229b34dde64026b1f7549f.tar.gz |
config: recognize empty no-attachment-warning
Documentation above no-attachment-warning states
"Leave empty to disable this feature".
However, when left empty, it would always warn before sending an email
without any attachments. Change to no warning if left empty.
Signed-off-by: Nojus Gudinavičius <nojus.gudinavicius@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config/compose.go')
-rw-r--r-- | config/compose.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/config/compose.go b/config/compose.go index 017b9efb..4b92bddc 100644 --- a/config/compose.go +++ b/config/compose.go @@ -34,5 +34,8 @@ func (c *ComposeConfig) ParseLayout(sec *ini.Section, key *ini.Key) ([][]string, } func (c *ComposeConfig) ParseNoAttachmentWarning(sec *ini.Section, key *ini.Key) (*regexp.Regexp, error) { + if key.String() == "" { + return nil, nil + } return regexp.Compile(`(?im)` + key.String()) } |