Fix for duplicate plugins being listed on Mac bug 103393 r=av sr=attinasi

git-svn-id: svn://10.0.0.236/trunk@105140 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterlubczynski%netscape.com
2001-10-11 04:43:16 +00:00
parent 57fb5f50ec
commit fe345ee2cf

View File

@@ -4226,16 +4226,15 @@ static PRBool areTheSameFileNames(char * aPath1, char * aPath2)
nsCOMPtr<nsILocalFile> file1;
nsCOMPtr<nsILocalFile> file2;
rv = NS_NewLocalFile(aPath1, PR_FALSE, getter_AddRefs(file1));
if(NS_FAILED(rv))
return PR_FALSE;
if (NS_SUCCEEDED(NS_NewLocalFile(aPath1, PR_FALSE, getter_AddRefs(file1))))
file1->GetLeafName(getter_Copies(filename1));
else //XXX if we couldn't create an nsILocalFile, try comparing raw string anyway
filename1.Adopt(PL_strdup(aPath1));
rv = NS_NewLocalFile(aPath2, PR_FALSE, getter_AddRefs(file2));
if(NS_FAILED(rv))
return PR_FALSE;
file1->GetLeafName(getter_Copies(filename1));
file2->GetLeafName(getter_Copies(filename2));
if (NS_SUCCEEDED(NS_NewLocalFile(aPath2, PR_FALSE, getter_AddRefs(file2))))
file2->GetLeafName(getter_Copies(filename2));
else //XXX workaround for Mac that sometimes passes in just a leaf name
filename2.Adopt(PL_strdup(aPath2));
if(PL_strlen(filename1.get()) != PL_strlen(filename2.get()))
return PR_FALSE;