Fix 1696282. To find the extension, look for the last '.' in the output filename...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 8 Apr 2007 03:42:41 +0000 (03:42 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 8 Apr 2007 03:42:41 +0000 (03:42 +0000)
git-svn-id: http://svn.voria.com/code@444 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/tool/main.cpp

index 387670d..424d2ea 100644 (file)
@@ -955,19 +955,14 @@ int main(int argc, char *argv[])
                        // If the target type is not yet defined,
                        // try to figure it out from the outfile.
                        if(target_name.empty() && !job_list.front().outfilename.empty())
-                       try
                        {
                                VERBOSE_OUT(3)<<_("Target name undefined, attempting to figure it out")<<endl;
-                               string ext=string(find(job_list.front().outfilename.begin(),job_list.front().outfilename.end(),'.')+1,job_list.front().outfilename.end());
+                               string ext=job_list.front().outfilename.substr(job_list.front().outfilename.rfind('.')+1);
                                if(Target::ext_book().count(ext))
                                        target_name=Target::ext_book()[ext];
                                else
                                        target_name=ext;
                        }
-                       catch(std::length_error)
-                       {
-                               synfig::warning("Length error caught when attempting to figure out target name");
-                       }
 
                        // If the target type is STILL not yet defined, then
                        // set it to a some sort of default