Index: shell/ev-view.c
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-view.c,v
retrieving revision 1.138
diff -u -d -r1.138 ev-view.c
--- shell/ev-view.c	30 Jul 2005 23:11:25 -0000	1.138
+++ shell/ev-view.c	31 Jul 2005 17:49:10 -0000
@@ -2783,21 +2783,27 @@
 
 	n_pages = ev_page_cache_get_n_pages (page_cache);
 
-	view->find_result--;
+	if (n_results > 0 && view->find_result > 0) {
 
-	if (view->find_result < 0) {
-		view->find_result = 0;
-		view->find_page--;
+		view->find_result--;
 
-		if (view->find_page < 0) {
-			view->find_page = n_pages - 1;
-		}
+	} else {
 
+		do {
+			view->find_page--;
+			if (view->find_page < 0) {
+				view->find_page = n_pages - 1;
+			}
+			n_results = ev_document_find_get_n_results(find, view->find_page);
+		} while(n_results == 0);
+		
 		jump_to_find_page (view);
-	} else {
-		jump_to_find_result (view);
-		gtk_widget_queue_draw (GTK_WIDGET (view));
+		view->find_result = n_results - 1;
 	}
+
+	jump_to_find_result (view);
+	gtk_widget_queue_draw (GTK_WIDGET (view));
+		
 }
 
 /*** Selections ***/
