From: erg Date: Mon, 12 Mar 2007 17:30:12 +0000 (+0000) Subject: Integrate Windows strcasecmp into write.c where it is used. X-Git-Tag: LAST_LIBGRAPH~32^2~5644 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb8ff966441347f87fb7f51b1ff74ee6a41c5f96;p=graphviz Integrate Windows strcasecmp into write.c where it is used. --- diff --git a/lib/agraph/write.c b/lib/agraph/write.c index 390de7bd4..005ef783c 100644 --- a/lib/agraph/write.c +++ b/lib/agraph/write.c @@ -44,6 +44,24 @@ static void indent(Agraph_t * g, iochan_t * ofile) ioput(g, ofile, "\t"); } +#ifndef HAVE_STRCASECMP + +#include + +int strcasecmp(const char *s1, const char *s2) +{ + while ((*s1 != '\0') + && (tolower(*(unsigned char *) s1) == + tolower(*(unsigned char *) s2))) { + s1++; + s2++; + } + + return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); +} + +#endif /* HAVE_STRCASECMP */ + /* _agcanonstr: * Canonicalize ordinary strings. * Assumes buf is large enough to hold output.