From 2baa9c35cf76fba172792cf62c0b85f846ff4b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Thu, 28 Jan 1999 23:02:23 +0100 Subject: [PATCH] Hopefully fixed bug in arg "any" handling. Rev: lib/modules/Protocols.pmod/IMAP.pmod/requests.pmod:1.17 --- .gitattributes | 1 + .../Protocols.pmod/IMAP.pmod/requests.pmod | 55 ++++++++++--------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.gitattributes b/.gitattributes index 7bd20ae126..7e4565b909 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,3 +8,4 @@ # Remove the corresponding line before committing # changes to these files. /lib/modules/Protocols.pmod/IMAP.pmod/imap_server.pike foreign_ident +/lib/modules/Protocols.pmod/IMAP.pmod/requests.pmod foreign_ident diff --git a/lib/modules/Protocols.pmod/IMAP.pmod/requests.pmod b/lib/modules/Protocols.pmod/IMAP.pmod/requests.pmod index fb3ea3d1ed..dd95d992b1 100644 --- a/lib/modules/Protocols.pmod/IMAP.pmod/requests.pmod +++ b/lib/modules/Protocols.pmod/IMAP.pmod/requests.pmod @@ -1,5 +1,6 @@ /* IMAP.requests * + * $Id: requests.pmod,v 1.17 1999/01/28 22:02:23 grubba Exp $ */ import .types; @@ -86,7 +87,9 @@ class request case "any": /* A single atom or string or a list of atoms (with * options), lists. Used for fetch. */ - return parser->get_any(arg_info[argc][1], 0, append_arg); + // FIXME: Are the arguments correct? + // /grubba 1999-01-28 + return parser->get_any(arg_info[argc][1], 0, 0, append_arg); case "varargs": /* Like any, but with an implicit list at top-level */ @@ -176,23 +179,23 @@ class list ({ "astring" }) }); mapping easy_process(string reference, string glob) - { - /* Each element of the array should be an array with three elements, - * attributes, hierarchy delimiter, and the name. */ + { + /* Each element of the array should be an array with three elements, + * attributes, hierarchy delimiter, and the name. */ - if ( (reference == "") - && (lower_case(glob) == "inbox") ) - glob = "INBOX"; + if ( (reference == "") + && (lower_case(glob) == "inbox") ) + glob = "INBOX"; - array mailboxes = server->list(session, reference, glob); + array mailboxes = server->list(session, reference, glob); - if (mailboxes) - foreach(mailboxes, array a) - send("*", @a); + if (mailboxes) + foreach(mailboxes, array a) + send("*", @a); - send(tag, "OK"); - return ([ "action" : "finished" ]); - } + send(tag, "OK"); + return ([ "action" : "finished" ]); + } } class lsub @@ -227,23 +230,23 @@ class select constant arg_info = ({ ({ "astring" }) }); mapping easy_process(string mailbox) - { - if (lower_case(mailbox) == "inbox") - mailbox = "INBOX"; + { + if (lower_case(mailbox) == "inbox") + mailbox = "INBOX"; - array info = server->select(session, mailbox); + array info = server->select(session, mailbox); - if (info) - { - foreach(info, array a) - send("*", @a); - send(tag, "OK", imap_prefix( ({ "READ-WRITE" }) ) ); + if (info) + { + foreach(info, array a) + send("*", @a); + send(tag, "OK", imap_prefix( ({ "READ-WRITE" }) ) ); return ([ "action" : "selected_state" ]); - } else { - send(tag, "NO"); + } else { + send(tag, "NO"); return ([ "action" : "logged_in_state" ]); - } } + } } class fetch -- GitLab