aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2019-05-16 00:06:17 +0200
committerGuilhem Moulin <guilhem@fripost.org>2019-05-27 00:07:29 +0200
commit1c5274b67308c10512e275d018ee18befcfb487f (patch)
treef3f5b17668ffdc16b084b22c389008feb7a692fb /lib
parent2be6268e01a368817b27cdbbee7b2641ec1653c6 (diff)
libinterimap: quote() the empty string as "" instead of a 0-length literal.
Compression asside, this saves 3 bytes and one round-trip on servers not supporting non-synchronizing literals, and 4 bytes otherwise.
Diffstat (limited to 'lib')
-rw-r--r--lib/Net/IMAP/InterIMAP.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm
index 37616f4..26c3712 100644
--- a/lib/Net/IMAP/InterIMAP.pm
+++ b/lib/Net/IMAP/InterIMAP.pm
@@ -239,7 +239,7 @@ sub quote($) {
if ($str =~ qr/\A$RE_ASTRING_CHAR+\z/) {
return $str;
}
- elsif ($str =~ qr/\A$RE_TEXT_CHAR+\z/) {
+ elsif ($str =~ qr/\A$RE_TEXT_CHAR*\z/) {
$str =~ s/([\x22\x5C])/\\$1/g;
return "\"$str\"";
}