From c6b1763d96c85b4f92530a8255952ef545cf230d Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 12 Jan 2015 19:00:44 -0500 Subject: [PATCH] [STORM-1949] Add default values for ExternalEditor Thankies Cinder~ --- indra/newview/llexternaleditor.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index c016b8da6..97343d792 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -41,8 +41,20 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env std::string cmd = findCommand(env_var, override); if (cmd.empty()) { - llwarns << "Editor command is empty or not set" << llendl; - return EC_NOT_SPECIFIED; +#if LL_WINDOWS + cmd = getenv("COMSPEC") + std::string(" /C START \"%s\""); +#elif LL_DARWIN + cmd = "/usr/bin/open \"%s\""; +#elif LL_LINUX + // xdg-open might not actually be installed on all distros, but it's our best bet. + cmd = "/usr/bin/xdg-open \"%s\""; +#endif + cmd = findCommand(LLStringUtil::null, cmd); + if (cmd.empty()) + { + llwarns << "Failed to find generic open handler." << llendl; + return EC_NOT_SPECIFIED; + } } // Add the filename marker if missing.