diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-06-27 08:16:03 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-06-27 08:16:03 +0000 |
commit | e0ad93e853d892132bbc9100f6e57a437528aae5 (patch) | |
tree | 624083c53414e0fda6fe6cf29ce84eae83d57ef0 /lib/libcurses/tty/lib_mvcur.c | |
parent | c1da0c612ee213cbca9ce22e3e9ccc39fe62e5cc (diff) |
ncurses-5.0-990626
Diffstat (limited to 'lib/libcurses/tty/lib_mvcur.c')
-rw-r--r-- | lib/libcurses/tty/lib_mvcur.c | 22 |
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) |