if ( idx )
*idx = n;
}
+ else if ( idx )
+ {
+ // different from any valid index
+ *idx = (size_t)-1;
+ }
return s;
}
nLine++;
} // end of while, save any data
- if (! curMimeType.empty())
+ if ( curMimeType.empty() )
+ delete entry;
+ else
AddToMimeData( curMimeType, curIconFile, entry, strExtensions, strDesc);
}
count++;
if ( vrb.IsSameAs(wxT("open")))
{
- verbs->Insert(vrb, 0u);
- commands ->Insert(cmd, 0u);
+ if ( verbs )
+ verbs->Insert(vrb, 0u);
+ if ( commands )
+ commands ->Insert(cmd, 0u);
}
else
{
- verbs->Add(vrb);
- commands->Add(cmd);
+ if ( verbs )
+ verbs->Add(vrb);
+ if ( commands )
+ commands->Add(cmd);
}
}
}
pEnd = wxStrchr(++pc, wxT('"'));
if ( pEnd == NULL )
{
- wxLogWarning(wxT("Mime.types file %s, line %d: unterminated quoted string."),
- strFileName.c_str(), nLine + 1);
+ wxLogWarning(wxT("Mime.types file %s, line %lu: unterminated quoted string."),
+ strFileName.c_str(), nLine + 1L);
}
}
else
// unregistered extensions according to the standard practice,
// but it may be worth telling the user about other junk in
// his mime.types file
- wxLogWarning(wxT("Unknown field in file %s, line %d: '%s'."),
- strFileName.c_str(), nLine + 1, strLHS.c_str());
+ wxLogWarning(wxT("Unknown field in file %s, line %lu: '%s'."),
+ strFileName.c_str(), nLine + 1L, strLHS.c_str());
}
if ( !entryEnded )
wxLogDebug(wxT("Mailcap file %s, line %lu: '\\' on the end of the last line ignored."),
strFileName.c_str(),
- (unsigned long)nLine + 1);
+ nLine + 1L);
}
else
{
(
wxT("Mailcap file %s, line %lu: unknown field '%s' for the MIME type '%s' ignored."),
strFileName.c_str(),
- (unsigned long)nLine + 1,
+ nLine + 1L,
curField.c_str(),
data.type.c_str()
);
// check that we really read something reasonable
if ( currentToken < Field_Other )
{
- wxLogWarning(wxT("Mailcap file %s, line %d: incomplete entry ignored."),
- strFileName.c_str(), nLine + 1);
+ wxLogWarning(wxT("Mailcap file %s, line %lu: incomplete entry ignored."),
+ strFileName.c_str(), nLine + 1L);
continue;
}