]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dbgrptg.cpp
Put a humane end to the pathetic flailing over whether this can
[wxWidgets.git] / src / generic / dbgrptg.cpp
index 734054bfca9577501b54ca6539a769d5b558f5ae..92a3b55c502bfe984183573adc78e2256b158e85 100644 (file)
@@ -439,13 +439,20 @@ void wxDebugReportDialog::OnOpen(wxCommandEvent& )
 
             // if we don't have place marker for file name in the command...
             wxString cmd = dlg.GetCommand();
-            if ( cmd.find(_T('%')) == wxString::npos )
+            if ( !cmd.empty() )
             {
-                // ...add it
-                cmd += _T(" \"%s\"");
+#if wxUSE_MIMETYPE
+                if ( cmd.find(_T('%')) != wxString::npos )
+                {
+                    command = wxFileType::ExpandCommand(cmd, fn.GetFullPath());
+                }
+                else // no %s nor %1
+#endif // wxUSE_MIMETYPE
+                {
+                    // append the file name to the end
+                    command << cmd << _T(" \"") << fn.GetFullPath() << _T('"');
+                }
             }
-
-            command = wxFileType::ExpandCommand(cmd, fn.GetFullPath());
         }
     }