Fixed standard 'backward iteration with unsigned var' bug.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10682 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
0660acfd9c
commit
4536dd81ff
|
@ -102,15 +102,13 @@ AssociatedTypes::GuessMimeType(const char *filename, BString *result)
|
||||||
err = BuildAssociatedTypesTable();
|
err = BuildAssociatedTypesTable();
|
||||||
if (!err) {
|
if (!err) {
|
||||||
// Extract the extension from the file
|
// Extract the extension from the file
|
||||||
uint i = strlen(filename);
|
const char *rawExtension = strrchr(filename, '.');
|
||||||
while (i-1 >= 0 && filename[i-1] != '.')
|
|
||||||
i--;
|
|
||||||
|
|
||||||
// If there was an extension, grab it and look up its associated
|
// If there was an extension, grab it and look up its associated
|
||||||
// type(s). Otherwise, the best guess we can offer is
|
// type(s). Otherwise, the best guess we can offer is
|
||||||
// "application/octect-stream"
|
// "application/octect-stream"
|
||||||
if (i > 0) {
|
if (rawExtension && rawExtension[1] != '\0') {
|
||||||
std::string extension = PrepExtension(&(filename[i]));
|
std::string extension = PrepExtension(rawExtension + 1);
|
||||||
|
|
||||||
/*! \todo I'm just grabbing the first item in the set here. Should we perhaps
|
/*! \todo I'm just grabbing the first item in the set here. Should we perhaps
|
||||||
do something different?
|
do something different?
|
||||||
|
|
Loading…
Reference in New Issue