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:
Glenn Kasten
2011-03-14 11:32:29 -07:00
parent 8980847d14
commit 41b3d3be18
5 changed files with 6 additions and 162 deletions

View File

@@ -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);
}
/**