james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1130255 - /james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java
Date Wed, 01 Jun 2011 18:35:12 GMT
Author: norman
Date: Wed Jun  1 18:35:12 2011
New Revision: 1130255

URL: http://svn.apache.org/viewvc?rev=1130255&view=rev
Log:
Fix problem with parsing "A SEARCH RECENT" which I introduced when implement ESEARCH. Shame
on me...

Modified:
    james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java

Modified: james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java?rev=1130255&r1=1130254&r2=1130255&view=diff
==============================================================================
--- james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java
(original)
+++ james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java
Wed Jun  1 18:35:12 2011
@@ -999,16 +999,23 @@ public class SearchCommandParser extends
                     throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown
search key");
                 }
             }
-            
-            // Parse the search term from the request
-            final SearchKey key = decode(session, request);
-            
             final SearchKey finalKey;
+
             if (recent != null) {
-                finalKey = SearchKey.buildAnd(Arrays.asList(recent, key));
+                if (request.nextChar() != ' ') {
+                    request.eol();
+                    finalKey = recent;
+                } else {
+                    // Parse the search term from the request
+                    final SearchKey key = decode(session, request);
+                    finalKey = SearchKey.buildAnd(Arrays.asList(recent, key));
+                }
             } else {
-                finalKey = key;
+                // Parse the search term from the request
+                finalKey = decode(session, request);
             }
+           
+            
             
             if (options == null) {
                 options = new ArrayList<SearchResultOption>();



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message