]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/relocate.cc
Imported Upstream version 2.14.2
[lilypond.git] / lily / relocate.cc
index 25e1daa244a287908fc65de5f8fcd1677ce089f3..628187363bd39aa8417064146bf779189f5cbfdd 100644 (file)
@@ -1,10 +1,20 @@
 /*
-  relocate.cc -- implement relocation based on argv0
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-  (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
 
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "relocate.hh"
@@ -191,17 +201,18 @@ setup_paths (char const *argv0_ptr)
              File_path path;
              path.parse_path (getenv ("PATH"));
 
-             if (be_verbose_global)
-               warning (_f ("Relocation: from PATH=%s\nargv0=%s",
-                            path.to_string ().c_str (), argv0_ptr));
-
 #ifndef __MINGW32__
              argv0_abs = path.find (argv0_filename.to_string ());
 #else /* __MINGW32__ */
+             path.prepend (get_working_directory ());
              char const *ext[] = {"exe", "", 0 };
              argv0_abs = path.find (argv0_filename.to_string (), ext);
 #endif /* __MINGW32__ */
 
+             if (be_verbose_global)
+               warning (_f ("Relocation: from PATH=%s\nargv0=%s",
+                            path.to_string ().c_str (), argv0_ptr));
+
              if (argv0_abs.empty ())
                programming_error ("cannot find absolute argv0");
            }