aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Net/IMAP
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-09-13 13:37:50 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-09-13 14:47:00 +0200
commita4729170cffc902319b08bae86e1ab6e20a7939d (patch)
tree11a55937493cf036c2c199842076a83173d7a70a /lib/Net/IMAP
parentcd7d385b4a27d028a7c7f92e1cd781b65b8ca5eb (diff)
Fix detection of boolean options.
Diffstat (limited to 'lib/Net/IMAP')
-rw-r--r--lib/Net/IMAP/InterIMAP.pm11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm
index 65a0c10..678e09d 100644
--- a/lib/Net/IMAP/InterIMAP.pm
+++ b/lib/Net/IMAP/InterIMAP.pm
@@ -100,7 +100,7 @@ sub read_config($$%) {
die "Invalid option $k\n" unless defined $opts{$k};
next unless defined $conf->{$k};
die "Invalid option $k = $conf->{$k}\n" unless $conf->{$k} =~ $opts{$k};
- $conf->{$k} = $1;
+ $conf->{$k} = $opts{$k} ne qr/\A(YES|NO)\z/i ? $1 : uc $1 eq 'YES' ? 1 : 0;
}
}
return \%configs;
@@ -221,15 +221,6 @@ sub new($%) {
my $self = { @_ };
bless $self, $class;
- foreach (keys %$self) {
- next unless defined $self->{$_};
- if (uc $self->{$_} eq 'YES') {
- $self->{$_} = 1;
- } elsif (uc $self->{$_} eq 'NO') {
- $self->{$_} = 0;
- }
- }
-
# the IMAP state: one of 'UNAUTH', 'AUTH', 'SELECTED' or 'LOGOUT'
# (cf RFC 3501 section 3)
$self->{_STATE} = '';