1 /* @(#)streql.c	1.10 09/06/07 Copyright 1985, 1995-2009 J. Schilling */
2 /*
3  *	Check if two strings are equal
4  *
5  *	Copyright (c) 1985, 1995-2009 J. Schilling
6  */
7 /*
8  * The contents of this file are subject to the terms of the
9  * Common Development and Distribution License, Version 1.0 only
10  * (the "License").  You may not use this file except in compliance
11  * with the License.
12  *
13  * See the file CDDL.Schily.txt in this distribution for details.
14  * A copy of the CDDL is also available via the Internet at
15  * http://www.opensource.org/licenses/cddl1.txt
16  *
17  * When distributing Covered Code, include this CDDL HEADER in each
18  * file and include the License file CDDL.Schily.txt from this distribution.
19  */
20 
21 #include <schily/standard.h>
22 #include <schily/schily.h>
23 
24 EXPORT int
streql(a,b)25 streql(a, b)
26 	const char	*a;
27 	const char	*b;
28 {
29 	register const char	*s1 = a;
30 	register const char	*s2 = b;
31 
32 	if (s1 == NULL || s2 ==  NULL)
33 		return (FALSE);
34 
35 	if (s1 == s2)
36 		return (TRUE);
37 
38 	while (*s1 == *s2++)
39 		if (*s1++ == '\0')
40 			return (TRUE);
41 
42 	return (FALSE);
43 }
44