user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 4/5] imap: avoid warnings on non-slice mailboxes
  2020-07-07 20:37  6% [PATCH 0/5] uninitialized vs blank fixes Eric Wong
@ 2020-07-07 20:37  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-07-07 20:37 UTC (permalink / raw)
  To: meta

Non-slice mailboxes never have messages themselves,
so we must not assume a message exists when sending
untagged EXISTS messages.
---
 lib/PublicInbox/IMAP.pm | 1 +
 t/imapd.t               | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm
index d8c898f4b..8ab4b1e7d 100644
--- a/lib/PublicInbox/IMAP.pm
+++ b/lib/PublicInbox/IMAP.pm
@@ -246,6 +246,7 @@ sub uo2m_extend ($$;$) {
 	my $base = $self->{uid_base};
 	++$beg;
 	my $uids = $self->{ibx}->over->uid_range($beg, $base + UID_SLICE);
+	return $uo2m if !scalar(@$uids);
 	my @tmp; # [$UID_OFFSET] => $MSN
 	my $write_method = $_[2] // 'msg_more';
 	if (ref($uo2m)) {
diff --git a/t/imapd.t b/t/imapd.t
index 1ac6a4ab6..6cfced411 100644
--- a/t/imapd.t
+++ b/t/imapd.t
@@ -87,12 +87,16 @@ my $post_auth_anon_capa = $mic->capability;
 is_deeply($post_auth_anon_capa, $post_login_capa,
 	'auth anon has same capabilities');
 my $e;
+ok($mic->noop, 'NOOP');
+ok($mic->noop, 'NOOP (again)'); # for warnings
 ok(!$mic->examine('foo') && ($e = $@), 'EXAMINE non-existent');
 like($e, qr/\bNO\b/, 'got a NO on EXAMINE for non-existent');
 ok(!$mic->select('foo') && ($e = $@), 'EXAMINE non-existent');
 like($e, qr/\bNO\b/, 'got a NO on EXAMINE for non-existent');
 my $mailbox1 = "inbox.i1.$first_range";
 ok($mic->select('inbox.i1'), 'SELECT on parent succeeds');
+ok($mic->noop, 'NOOP while selected');
+ok($mic->noop, 'NOOP again while selected'); # check warnings later
 ok($mic->select($mailbox1), 'SELECT succeeds');
 ok($mic->examine($mailbox1), 'EXAMINE succeeds');
 my @raw = $mic->status($mailbox1, qw(Messages uidnext uidvalidity));

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/5] uninitialized vs blank fixes
@ 2020-07-07 20:37  6% Eric Wong
  2020-07-07 20:37  7% ` [PATCH 4/5] imap: avoid warnings on non-slice mailboxes Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-07-07 20:37 UTC (permalink / raw)
  To: meta

This quiets some uninitialized variable warnings in various
places and includes minor fixes around "//" vs "||".

Eric Wong (5):
  viewvcs: allow "0" as a path name
  hval: to_filename: return `undef' instead of empty string
  viewvcs: stop checking unused "B" query parameter
  imap: avoid warnings on non-slice mailboxes
  wwwatomstream: avoid uninitialized warnings for $email

 lib/PublicInbox/Hval.pm          |  4 ++--
 lib/PublicInbox/IMAP.pm          |  1 +
 lib/PublicInbox/Mbox.pm          |  4 ++--
 lib/PublicInbox/MboxGz.pm        |  3 +--
 lib/PublicInbox/SolverGit.pm     |  2 +-
 lib/PublicInbox/ViewVCS.pm       |  8 +++++---
 lib/PublicInbox/WWW.pm           |  5 ++---
 lib/PublicInbox/WwwAtomStream.pm | 13 +++++--------
 t/hval.t                         |  8 +++++---
 t/imapd.t                        |  4 ++++
 10 files changed, 28 insertions(+), 24 deletions(-)


^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-07-07 20:37  6% [PATCH 0/5] uninitialized vs blank fixes Eric Wong
2020-07-07 20:37  7% ` [PATCH 4/5] imap: avoid warnings on non-slice mailboxes Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).