Modify 'ardour_config_search_path()' and 'ardour_data_search_path()'
authorJohn Emmas <johne53@tiscali.co.uk>
Wed, 19 Mar 2014 13:42:58 +0000 (13:42 +0000)
committerJohn Emmas <johne53@tiscali.co.uk>
Wed, 19 Mar 2014 13:42:58 +0000 (13:42 +0000)
     1) So that the Windows version will use appropriate environment variables (if they exist)
     2) So that we don't exit if the env vars can't be found (we can still return some kind of path so just alert the user)

libs/ardour/filesystem_paths.cc

index d889076717541d5ee13c37edbce795f587b6bf80..78232b16cd59a335f8b06b27b0f1876019a9ec50 100644 (file)
@@ -193,15 +193,13 @@ ardour_config_search_path ()
                search_path += user_config_directory();
 #ifdef PLATFORM_WINDOWS
                search_path += windows_search_path ();
-#else
+#endif
                std::string s = Glib::getenv("ARDOUR_CONFIG_PATH");
                if (s.empty()) {
-                       std::cerr << _("ARDOUR_CONFIG_PATH not set in environment - exiting\n");
-                       ::exit (1);
+                       std::cerr << _("ARDOUR_CONFIG_PATH not set in environment\n");
+               } else {
+                       search_path += Searchpath (s);
                }
-               
-               search_path += Searchpath (s);
-#endif
        }
 
        return search_path;
@@ -216,15 +214,13 @@ ardour_data_search_path ()
                search_path += user_config_directory();
 #ifdef PLATFORM_WINDOWS
                search_path += windows_search_path ();
-#else
+#endif
                std::string s = Glib::getenv("ARDOUR_DATA_PATH");
                if (s.empty()) {
-                       std::cerr << _("ARDOUR_DATA_PATH not set in environment - exiting\n");
-                       ::exit (1);
+                       std::cerr << _("ARDOUR_DATA_PATH not set in environment\n");
+               } else {
+                       search_path += Searchpath (s);
                }
-               
-               search_path += Searchpath (s);
-#endif
        }
 
        return search_path;