]> Creatis software - bbtkGEditor.git/commitdiff
#1356
authorcamarasu <>
Wed, 23 May 2012 08:46:17 +0000 (08:46 +0000)
committercamarasu <>
Wed, 23 May 2012 08:46:17 +0000 (08:46 +0000)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx

index d9a00b955053d7412eef47ef55078cc77b84f2e2..94d6e548caf7a07d41f3e9a869ce39bc26694b02 100644 (file)
@@ -462,16 +462,12 @@ void wxGUIEditorGraphicBBS::executeScript(std::string script) {
 
 //=========================================================================
 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;
 }