OLD | NEW |
1 /* | 1 /* |
2 * strcasecmp() implementation for systems that don't have it or stricmp() | 2 * strcasecmp() implementation for systems that don't have it or stricmp() |
3 * or strcmpi(). | 3 * or strcmpi(). |
4 * | 4 * |
5 * Copyright (c) 1987, 1993 | 5 * Copyright (c) 1987, 1993 |
6 * The Regents of the University of California. All rights reserved. | 6 * The Regents of the University of California. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 12 matching lines...) Expand all Loading... |
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 * SUCH DAMAGE. | 30 * SUCH DAMAGE. |
31 */ | 31 */ |
32 #include "util.h" | 32 #include "util.h" |
33 /*@unused@*/ RCSID("$Id: strcasecmp.c 1893 2007-07-14 03:11:32Z peter $"); | |
34 | |
35 | 33 |
36 #ifndef USE_OUR_OWN_STRCASECMP | 34 #ifndef USE_OUR_OWN_STRCASECMP |
37 #undef yasm__strcasecmp | 35 #undef yasm__strcasecmp |
38 #undef yasm__strncasecmp | 36 #undef yasm__strncasecmp |
39 #endif | 37 #endif |
40 | 38 |
41 #if defined(LIBC_SCCS) && !defined(lint) | 39 #if defined(LIBC_SCCS) && !defined(lint) |
42 static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; | 40 static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; |
43 #endif /* LIBC_SCCS and not lint */ | 41 #endif /* LIBC_SCCS and not lint */ |
44 | 42 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 do { | 85 do { |
88 if (tolower(*us1) != tolower(*us2++)) | 86 if (tolower(*us1) != tolower(*us2++)) |
89 return (tolower(*us1) - tolower(*--us2)); | 87 return (tolower(*us1) - tolower(*--us2)); |
90 if (*us1++ == '\0') | 88 if (*us1++ == '\0') |
91 break; | 89 break; |
92 } while (--n != 0); | 90 } while (--n != 0); |
93 } | 91 } |
94 return (0); | 92 return (0); |
95 #endif | 93 #endif |
96 } | 94 } |
OLD | NEW |