Fix whitespace in quicksearch bar
authorKeith Edmunds <keith@midnighthax.com>
Sat, 28 Feb 2004 13:18:33 +0000 (13:18 +0000)
committerKeith Edmunds <keith@midnighthax.com>
Sat, 28 Feb 2004 13:18:33 +0000 (13:18 +0000)
ChangeLog.claws
configure.ac
src/common/utils.c

index 8c332ba..73bf3fe 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-28 [keith]     0.9.9claws36
+
+       * src/common/utils.c
+               Fix treatment of whitespace in quicksearch bar (leading
+               spaces and >1 space between commands and parameters).
+
 2004-02-27 [alfons]    0.9.9claws35
 
        * src/compose.[ch]
index df56e63..5838237 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=35
+EXTRA_VERSION=36
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index fbf4b14..ecd067c 100644 (file)
@@ -3523,11 +3523,12 @@ gchar *expand_search_string(const gchar *search_string)
                return copy_str;
 
        matcherstr = g_string_sized_new(16);
-       cmd_start = cmd_end = copy_str;
-       while (cmd_end && *cmd_end) {
+       cmd_start = copy_str;
+       while (cmd_start && *cmd_start) {
                /* skip all white spaces */
-               while (*cmd_end && isspace((guchar)*cmd_end))
-                       cmd_end++;
+               while (*cmd_start && isspace((guchar)*cmd_start))
+                       cmd_start++;
+        cmd_end = cmd_start;
 
                /* extract a command */
                while (*cmd_end && !isspace((guchar)*cmd_end))
@@ -3573,7 +3574,8 @@ gchar *expand_search_string(const gchar *search_string)
                                        break;
 
                                /* extract a parameter, allow quotes */
-                               cmd_end++;
+                while (*cmd_end && isspace((guchar)*cmd_end))
+                             cmd_end++;
                                cmd_start = cmd_end;
                                if (*cmd_start == '"') {
                                        term_char = '"';
@@ -3586,9 +3588,6 @@ gchar *expand_search_string(const gchar *search_string)
                                while ((*cmd_end) && (*cmd_end != term_char))
                                        cmd_end++;
 
-                               if (*cmd_end && (*cmd_end != term_char))
-                                       break;
-
                                if (*cmd_end == '"')
                                        cmd_end++;
 
@@ -3620,10 +3619,9 @@ gchar *expand_search_string(const gchar *search_string)
                        }
                }
 
-               if (*cmd_end) {
+               if (*cmd_end)
                        cmd_end++;
-                       cmd_start = cmd_end;
-               }
+               cmd_start = cmd_end;
        }
 
        g_free(copy_str);