From 929d758f31977096ed54700a7b4c79ca3ad1884f Mon Sep 17 00:00:00 2001 From: spider Date: Thu, 30 Apr 1998 16:40:38 +0000 Subject: [PATCH] Fix UNIX build bustage git-svn-id: svn://10.0.0.236/trunk@909 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/nsCRT.h | 5 +++++ mozilla/htmlparser/src/nsHTMLParser.cpp | 2 +- mozilla/parser/htmlparser/src/nsHTMLParser.cpp | 2 +- mozilla/xpcom/ds/nsCRT.h | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mozilla/base/src/nsCRT.h b/mozilla/base/src/nsCRT.h index a14ed2bbcb5..0161c67e129 100644 --- a/mozilla/base/src/nsCRT.h +++ b/mozilla/base/src/nsCRT.h @@ -66,6 +66,11 @@ public: return PRInt32(PL_strcasecmp(s1, s2)); } + /// Case-insensitive string comparison with length + static PRInt32 strncasecmp(const char* s1, const char* s2, PRInt32 aMaxLen) { + return PRInt32(PL_strncasecmp(s1, s2, aMaxLen)); + } + /// Like strlen except for ucs2 strings static PRInt32 strlen(const PRUnichar* s); diff --git a/mozilla/htmlparser/src/nsHTMLParser.cpp b/mozilla/htmlparser/src/nsHTMLParser.cpp index c221c423224..e39e6d31af1 100644 --- a/mozilla/htmlparser/src/nsHTMLParser.cpp +++ b/mozilla/htmlparser/src/nsHTMLParser.cpp @@ -462,7 +462,7 @@ PRBool nsHTMLParser::Parse(nsIURL* aURL){ char* theModeStr= PR_GetEnv("PARSE_MODE"); if(theModeStr) - if(0==strnicmp("other",theModeStr,5)) + if(0==nsCRT::strncasecmp("other",theModeStr,5)) theMode=eParseMode_other; return Parse(aURL,theMode); diff --git a/mozilla/parser/htmlparser/src/nsHTMLParser.cpp b/mozilla/parser/htmlparser/src/nsHTMLParser.cpp index c221c423224..e39e6d31af1 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLParser.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLParser.cpp @@ -462,7 +462,7 @@ PRBool nsHTMLParser::Parse(nsIURL* aURL){ char* theModeStr= PR_GetEnv("PARSE_MODE"); if(theModeStr) - if(0==strnicmp("other",theModeStr,5)) + if(0==nsCRT::strncasecmp("other",theModeStr,5)) theMode=eParseMode_other; return Parse(aURL,theMode); diff --git a/mozilla/xpcom/ds/nsCRT.h b/mozilla/xpcom/ds/nsCRT.h index a14ed2bbcb5..0161c67e129 100644 --- a/mozilla/xpcom/ds/nsCRT.h +++ b/mozilla/xpcom/ds/nsCRT.h @@ -66,6 +66,11 @@ public: return PRInt32(PL_strcasecmp(s1, s2)); } + /// Case-insensitive string comparison with length + static PRInt32 strncasecmp(const char* s1, const char* s2, PRInt32 aMaxLen) { + return PRInt32(PL_strncasecmp(s1, s2, aMaxLen)); + } + /// Like strlen except for ucs2 strings static PRInt32 strlen(const PRUnichar* s);