summaryrefslogtreecommitdiff
path: root/lib/libcurses/tty/lib_mvcur.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-06-27 08:16:03 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-06-27 08:16:03 +0000
commite0ad93e853d892132bbc9100f6e57a437528aae5 (patch)
tree624083c53414e0fda6fe6cf29ce84eae83d57ef0 /lib/libcurses/tty/lib_mvcur.c
parentc1da0c612ee213cbca9ce22e3e9ccc39fe62e5cc (diff)
ncurses-5.0-990626
Diffstat (limited to 'lib/libcurses/tty/lib_mvcur.c')
-rw-r--r--lib/libcurses/tty/lib_mvcur.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/libcurses/tty/lib_mvcur.c b/lib/libcurses/tty/lib_mvcur.c
index a096cb6b16d..29e9f89d266 100644
--- a/lib/libcurses/tty/lib_mvcur.c
+++ b/lib/libcurses/tty/lib_mvcur.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_mvcur.c,v 1.2 1999/02/11 00:09:37 millert Exp $ */
+/* $OpenBSD: lib_mvcur.c,v 1.3 1999/06/27 08:14:21 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -155,7 +155,7 @@
#include <term.h>
#include <ctype.h>
-MODULE_ID("$From: lib_mvcur.c,v 1.56 1999/02/01 12:04:15 tom Exp $")
+MODULE_ID("$From: lib_mvcur.c,v 1.57 1999/06/26 22:16:04 tom Exp $")
#define STRLEN(s) (s != 0) ? strlen(s) : 0
@@ -177,6 +177,24 @@ static float diff;
static int normalized_cost(const char *const cap, int affcnt);
+#if !HAVE_STRSTR
+char * _nc_strstr(const char *haystack, const char *needle)
+{
+ size_t len1 = strlen(haystack);
+ size_t len2 = strlen(needle);
+ char *result = 0;
+
+ while ((len1 != 0) && (len1-- >= len2)) {
+ if (!strncmp(haystack, needle, len2)) {
+ result = haystack;
+ break;
+ }
+ haystack++;
+ }
+ return result;
+}
+#endif
+
/****************************************************************************
*
* Initialization/wrapup (including cost pre-computation)