[gnome-commander/gcmd-1-2-8] Fixed problem #602795 (file content search)



commit 9f2025efb6d9deb62ab7f9538a958528d9c1d5db
Author: PrzemysÅ?aw WesoÅ?ek <pwes o2 pl>
Date:   Mon Mar 1 20:22:03 2010 +0100

    Fixed problem #602795 (file content search)

 NEWS                           |    1 +
 doc/C/gnome-commander.xml      |    3 +++
 src/gnome-cmd-search-dialog.cc |    5 +++++
 3 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 6d47f99..676aca2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ gnome-commander 1.2.8.6
 ---------------
 
 Bug fixes:
+ * Fixed problem #602795 (file content search)
  * Fixed problem #609912 (build error with --as-needed)
 
 
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index 73467c3..e4d92a9 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6022,6 +6022,9 @@
                 <para>
                     <itemizedlist>
                         <listitem>
+                            <para>Fixed problem #602795 (file content search)</para>
+                        </listitem>
+                        <listitem>
                             <para>Fixed problem #609912 (build error with --as-needed)</para>
                         </listitem>
                     </itemizedlist>
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index ece211c..2a5d80b 100644
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -230,7 +230,12 @@ inline gboolean content_matches (GnomeCmdFile *f, SearchData *data)
         SearchFileData  *search_file = NULL;
 
         while ((search_file = read_search_file (data, search_file, f)) != NULL)
+        {
             ret = regexec (data->content_regex, data->search_mem, 1, &match, 0);
+            // stop on first match
+            if (ret != REG_NOMATCH)
+                break;
+        }
     }
 
     return ret != REG_NOMATCH;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]