]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 8 Jun 2005 13:45:29 +0000 (13:45 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 8 Jun 2005 13:45:29 +0000 (13:45 +0000)
ChangeLog
flower/file-path.cc
lily/lily-parser-scheme.cc

index f53ac857e4d8d55aaeb073b5c1d77a9181a776f4..1cebd1ba76a0e37bab9c5b8f21784f82eb8a11e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 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.
 
index 1df873325fb7f6db6613ce1b70e8320376ef34bb..ddadfaca5bd0a43190f58f84d48389fc8abf0bd1 100644 (file)
@@ -130,8 +130,8 @@ File_path::find (String name) const
       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 ();
     }
index ab80fff1ec75090ab6766d5af99dee75fbfe75df..0563d403c058a5e36e8c7124f6a1b02134e9d722 100644 (file)
@@ -54,7 +54,25 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
   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 ())