Bug 4016329 do full string comparisons
Use full string comparisons instead of partial for file extension and MIME type. Do case-insensitive comparison of MIME type and file extensions. Fix error in comment for String8::getPathExtension. Remove dead code -- StringTokenizer is unused. Change-Id: I322be6235abbdaab5f7eafa48926dbb2cf46dc29
This commit is contained in:
@@ -230,11 +230,9 @@ private:
|
||||
*/
|
||||
bool isPlugIn(const struct dirent* pEntry) const {
|
||||
String8 sName(pEntry->d_name);
|
||||
int extentionPos = sName.size() - String8(PLUGIN_EXTENSION).size();
|
||||
if (extentionPos < 0) {
|
||||
return false;
|
||||
}
|
||||
return extentionPos == (int)sName.find(PLUGIN_EXTENSION);
|
||||
String8 extension(sName.getPathExtension());
|
||||
// Note that the plug-in extension must exactly match case
|
||||
return extension == String8(PLUGIN_EXTENSION);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user