]> code.citadel.org Git - citadel.git/commitdiff
* Removed trailing space at the end of the list of messages returned by
authorArt Cancro <ajc@citadel.org>
Sat, 9 Jul 2005 11:30:19 +0000 (11:30 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 9 Jul 2005 11:30:19 +0000 (11:30 +0000)
  an IMAP SEARCH command.

citadel/ChangeLog
citadel/imap_search.c

index 73feb2faf8a2e9ce2c1aeff559b9ffe44514f8cf..cd7ddfdfa48629f864a32aae49ec9aa5a728eb55 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 653.1  2005/07/09 11:30:18  ajc
+* Removed trailing space at the end of the list of messages returned by
+  an IMAP SEARCH command.
+
 Revision 653.0  2005/07/06 21:41:52  ajc
 * THIS IS 6.53
 
@@ -6916,4 +6920,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index a179a759e283e4e92fbed70b4446f95502224734..560a25d3891895cd68a8ae5566f2624ff653cfa2 100644 (file)
@@ -446,6 +446,7 @@ void imap_do_search(int num_items, char **itemlist, int is_uid) {
        int fts_num_msgs = 0;
        long *fts_msgs = NULL;
        int is_in_list = 0;
+       int num_results = 0;
 
        /* If there is a BODY search criterion in the query, use our full
         * text index to disqualify messages that don't have any chance of
@@ -487,12 +488,16 @@ void imap_do_search(int num_items, char **itemlist, int is_uid) {
         for (i = 0; i < IMAP->num_msgs; ++i)
          if (IMAP->flags[i] & IMAP_SELECTED) {
                if (imap_do_search_msg(i+1, NULL, num_items, itemlist, is_uid)) {
+                       if (num_results != 0) {
+                               cprintf(" ");
+                       }
                        if (is_uid) {
-                               cprintf("%ld ", IMAP->msgids[i]);
+                               cprintf("%ld", IMAP->msgids[i]);
                        }
                        else {
-                               cprintf("%d ", i+1);
+                               cprintf("%d", i+1);
                        }
+                       ++num_results;
                }
        }
        cprintf("\r\n");