aboutsummaryrefslogtreecommitdiff
path: root/common/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/search.c')
-rw-r--r--common/search.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/common/search.c b/common/search.c
index 22f020315070..4831a0874aae 100644
--- a/common/search.c
+++ b/common/search.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "$Id: search.c,v 10.26 2011/07/04 20:16:26 zy Exp $";
+static const char sccsid[] = "$Id: search.c,v 10.27 2015/03/13 18:41:35 zy Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -30,8 +30,8 @@ static const char sccsid[] = "$Id: search.c,v 10.26 2011/07/04 20:16:26 zy Exp $
typedef enum { S_EMPTY, S_EOF, S_NOPREV, S_NOTFOUND, S_SOF, S_WRAP } smsg_t;
-static void search_msg __P((SCR *, smsg_t));
-static int search_init __P((SCR *, dir_t, CHAR_T *, size_t, CHAR_T **, u_int));
+static void search_msg(SCR *, smsg_t);
+static int search_init(SCR *, dir_t, CHAR_T *, size_t, CHAR_T **, u_int);
/*
* search_init --
@@ -142,8 +142,8 @@ prev: if (sp->re == NULL) {
* f_search --
* Do a forward search.
*
- * PUBLIC: int f_search __P((SCR *,
- * PUBLIC: MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int));
+ * PUBLIC: int f_search(SCR *,
+ * PUBLIC: MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int);
*/
int
f_search(
@@ -159,7 +159,7 @@ f_search(
recno_t lno;
regmatch_t match[1];
size_t coff, len;
- int cnt, eval, rval, wrapped;
+ int cnt, eval, rval, wrapped = 0;
CHAR_T *l;
if (search_init(sp, FORWARD, ptrn, plen, eptrn, flags))
@@ -198,13 +198,14 @@ f_search(
return (1);
}
lno = 1;
+ wrapped = 1;
}
} else
coff = fm->cno + 1;
}
btype = BUSY_ON;
- for (cnt = INTERRUPT_CHECK, rval = 1, wrapped = 0;; ++lno, coff = 0) {
+ for (cnt = INTERRUPT_CHECK, rval = 1;; ++lno, coff = 0) {
if (cnt-- == 0) {
if (INTERRUPTED(sp))
break;
@@ -288,8 +289,8 @@ f_search(
* b_search --
* Do a backward search.
*
- * PUBLIC: int b_search __P((SCR *,
- * PUBLIC: MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int));
+ * PUBLIC: int b_search(SCR *,
+ * PUBLIC: MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int);
*/
int
b_search(
@@ -487,7 +488,7 @@ search_msg(
* search_busy --
* Put up the busy searching message.
*
- * PUBLIC: void search_busy __P((SCR *, busy_t));
+ * PUBLIC: void search_busy(SCR *, busy_t);
*/
void
search_busy(