//=========================================================================
std::string wxGUIEditorGraphicBBS::CheckExtension(std::string filename, std::string extension) {
- if(extension.size() != 4){
- printf("CheckExtension Warning! Extension size != 4\n");
- }else{
- if(filename.size() > 4){
- if( (filename.compare(filename.size()-4,4,extension)) !=0 ){
- filename.append(extension);
- }
- }else{
- filename.append(extension);
+ if(filename.size() > extension.size() ){
+ if( (filename.compare(filename.size()-extension.size(), extension.size(),extension)) !=0 ){
+ filename.append(extension);
}
+ }else{
+ filename.append(extension);
}
return filename;
}