Revision 12455,
386 bytes
checked in by danw, 26 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r12454,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | |
---|
2 | /* |
---|
3 | * ssequal.c -- check if a string is a substring of another |
---|
4 | * |
---|
5 | * $Id: ssequal.c,v 1.1.1.1 1999-02-07 18:14:10 danw Exp $ |
---|
6 | */ |
---|
7 | |
---|
8 | #include <h/mh.h> |
---|
9 | |
---|
10 | /* |
---|
11 | * Check if s1 is a substring of s2. |
---|
12 | * If yes, then return 1, else return 0. |
---|
13 | */ |
---|
14 | |
---|
15 | int |
---|
16 | ssequal (char *s1, char *s2) |
---|
17 | { |
---|
18 | if (!s1) |
---|
19 | s1 = ""; |
---|
20 | if (!s2) |
---|
21 | s2 = ""; |
---|
22 | |
---|
23 | while (*s1) |
---|
24 | if (*s1++ != *s2++) |
---|
25 | return 0; |
---|
26 | return 1; |
---|
27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.