aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNojus Gudinavičius <nojus.gudinavicius@gmail.com>2023-07-13 16:14:48 +0300
committerRobin Jarry <robin@jarry.cc>2023-07-14 23:07:10 +0200
commit21cc3ce129b716f14b229b34dde64026b1f7549f (patch)
treef21dcd64c5ddf22a2b5027bd7d322aee7a2caa14
parent3a73ffb40ed1ddcb3ab3425ca79e12fca02949be (diff)
downloadaerc-21cc3ce129b716f14b229b34dde64026b1f7549f.tar.gz
aerc-21cc3ce129b716f14b229b34dde64026b1f7549f.zip
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>
-rw-r--r--config/compose.go3
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())
}