2 * strstr.c -- return the offset of one string within another.
4 * Copyright (C) 1997 Free Software Foundation, Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2, or (at your option) any later
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59
18 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 /* Written by Philippe De Muyter <phdm@info.ucl.ac.be>. */
26 * strstr -- locate first occurence of a substring
30 * char *strstr (char *s1, char *s2)
34 * Locates the first occurence in the string pointed to by S1 of the string
35 * pointed to by S2. Returns a pointer to the substring found, or a NULL
36 * pointer if not found. If S2 points to a string with zero length, the
37 * function returns S1.
64 sub
-= (unsigned long) bp
;
65 sub
+= (unsigned long) buf
;