--- c:\gtktextiterOLD.c	Wed Apr 05 13:30:46 2006
+++ c:\gtktextiter.c	Wed Dec 27 11:00:51 2006
@@ -4708,4 +4708,17 @@
                gtk_text_iter_compare (&end, limit) <= 0))
             {
+              /* If searching by whole word then verify that
+                 the found iterators can begin a word and
+                 end a word.
+              */
+              if (flags & GTK_TEXT_SEARCH_TEXT_WHOLE_WORD)
+                {
+                if (!gtk_text_iter_starts_word(&match) ||
+                    !gtk_text_iter_ends_word(&end))
+                  {
+                  continue;
+                  }
+                }
+              
               retval = TRUE;
               
@@ -5024,4 +5037,5 @@
               gtk_text_iter_compare (limit, &start_tmp) > 0)
             goto out; /* match was bogus */
+
           
           if (match_start)
@@ -5038,4 +5052,17 @@
           forward_chars_with_skipping (&next, offset,
                                        visible_only, !slice);
+
+          /* If searching by whole word then verify that
+             the found iterators can begin a word and
+             end a word.
+          */
+          if (flags & GTK_TEXT_SEARCH_TEXT_WHOLE_WORD)
+            {
+            if (!gtk_text_iter_starts_word(&start_tmp) ||
+                !gtk_text_iter_ends_word(&next))
+                  {
+                  continue;
+                  }
+            }
 
           if (match_end)
