summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2004-09-21 12:07:12 +0000
committerPaul Smith <psmith@gnu.org>2004-09-21 12:07:12 +0000
commit704c60cec021d75164c8a7c34bcd667e45f184e3 (patch)
treef910a966cede38013d111434ecf8e08e6547acd3 /misc.c
parent9714e501fb356adb043c77a3180a7f8c16c1484d (diff)
downloadgunmake-704c60cec021d75164c8a7c34bcd667e45f184e3.tar.gz
Remove sindex() and replace with strstr().
Windows: allow users to set SHELL to cmd.exe and have it behave as if no UNIX shell were found.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/misc.c b/misc.c
index 9d3ff4f..5532369 100644
--- a/misc.c
+++ b/misc.c
@@ -412,34 +412,6 @@ savestring (const char *str, unsigned int length)
return out;
}
-/* Search string BIG (length BLEN) for an occurrence of
- string SMALL (length SLEN). Return a pointer to the
- beginning of the first occurrence, or return nil if none found. */
-
-char *
-sindex (const char *big, unsigned int blen,
- const char *small, unsigned int slen)
-{
- if (!blen)
- blen = strlen (big);
- if (!slen)
- slen = strlen (small);
-
- if (slen && blen >= slen)
- {
- register unsigned int b;
-
- /* Quit when there's not enough room left for the small string. */
- --slen;
- blen -= slen;
-
- for (b = 0; b < blen; ++b, ++big)
- if (*big == *small && strneq (big + 1, small + 1, slen))
- return (char *)big;
- }
-
- return 0;
-}
/* Limited INDEX:
Search through the string STRING, which ends at LIMIT, for the character C.