From 8655259c3713af81663ba3265cb8cf051525bfda Mon Sep 17 00:00:00 2001 From: "bsmedberg%covad.net" Date: Thu, 20 May 2004 04:47:24 +0000 Subject: [PATCH] Make windows getRelativePath case-insensitive. r+sr=darin git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@156632 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileCommon.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/xpcom/io/nsLocalFileCommon.cpp b/mozilla/xpcom/io/nsLocalFileCommon.cpp index 178398cb6b0..cae327733f7 100644 --- a/mozilla/xpcom/io/nsLocalFileCommon.cpp +++ b/mozilla/xpcom/io/nsLocalFileCommon.cpp @@ -45,6 +45,10 @@ #include "nsPrintfCString.h" #include "nsCRT.h" +#ifdef XP_WIN +#include +#endif + void NS_StartupLocalFile() { @@ -193,9 +197,14 @@ nsLocalFile::GetRelativeDescriptor(nsILocalFile *fromFile, nsACString& _retval) if (thisNodeCnt < 0 || fromNodeCnt < 0) return NS_ERROR_FAILURE; - for (nodeIndex = 0; nodeIndex < thisNodeCnt && nodeIndex < fromNodeCnt; nodeIndex++) { + for (nodeIndex = 0; nodeIndex < thisNodeCnt && nodeIndex < fromNodeCnt; ++nodeIndex) { +#ifdef XP_WIN + if (_wcsicmp(thisNodes[nodeIndex], fromNodes[nodeIndex])) + break; +#else if (nsCRT::strcmp(thisNodes[nodeIndex], fromNodes[nodeIndex])) break; +#endif } PRInt32 branchIndex = nodeIndex;