aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog3
-rw-r--r--lib/Net/IMAP/InterIMAP.pm2
2 files changed, 4 insertions, 1 deletions
diff --git a/Changelog b/Changelog
index 17f4661..9cce062 100644
--- a/Changelog
+++ b/Changelog
@@ -3,6 +3,9 @@ interimap (0.5) upstream;
- libinterimap: bugfix: hierarchy delimiters in LIST responses were
returned as an escaped quoted special, like "\\", not as a single
character (backslash in this case).
+ - libinterimap: quote() the empty string as "" instead of a 0-length
+ literal. (This saves 3 bytes + one round-trip on servers not
+ supporting non-synchronizing literals, and 4 bytes otherwise.)
-- Guilhem Moulin <guilhem@fripost.org> Fri, 10 May 2019 00:58:14 +0200
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\"";
}