2005-06-08 Jan Nieuwenhuizen <janneke@gnu.org>
+ * flower/file-path.cc (find): Bugfix. Append rather than prepend
+ directory part of file name to search directory.
+
+ * lily/lily-parser-scheme.cc (ly:parse-file): Prepend cwd to
+ search path and chdir to DIR if --outname=DIR used.
+
* lily/main.cc (prepend_env_path): Bugfix: Check directory
existence before appending original path.
if (file_name.dir_.is_empty ())
file_name.dir_ = dir.to_string ();
else if (!dir.to_string ().is_empty())
- file_name.dir_ += ::to_string (DIRSEP) + dir.to_string ();
-
+ file_name.dir_ = dir.to_string ()
+ + ::to_string (DIRSEP) + file_name.dir_;
if (is_file (file_name.to_string ()))
return file_name.to_string ();
}
out_file_name.dir_ = "";
if (!output_name_global.is_empty ())
- out_file_name = File_name (output_name_global);
+ {
+ if (is_dir (output_name_global))
+ {
+ char cwd[PATH_MAX];
+ getcwd (cwd, PATH_MAX);
+
+ if (output_name_global != cwd)
+ {
+ global_path.prepend (cwd);
+ message (_f ("Changing working directory to `%s'",
+ output_name_global.to_str0 ()));
+ chdir (output_name_global.to_str0 ());
+
+ }
+ output_name_global = "";
+ }
+ else
+ out_file_name = File_name (output_name_global);
+ }
String init;
if (!init_name_global.is_empty ())