]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.8
authorfred <fred>
Sun, 24 Mar 2002 19:53:56 +0000 (19:53 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:53:56 +0000 (19:53 +0000)
flower/flower-debug.cc
flower/path.cc

index 7e0e519f574858f143a7ba48d9e633ba6db3cf6e..5ea5e50dc051ec66ee459bc03dddc34eae48c52b 100644 (file)
@@ -4,18 +4,19 @@
 
 bool flower_check_debug=false;
 ofstream null_device ( "/dev/null");
-Dstream default_flower_stream(&null_device ,"/dev/null");
+Dstream default_flower_stream (&null_device ,"/dev/null");
 Dstream *flower_dstream  = &default_flower_stream;
 
 /**
   Set the debugging output. Will not delete/swallow argument.
  */
-void set_flower_debug(Dstream&ds, bool b)
+void set_flower_debug (Dstream&ds, bool b)
 {
 #ifdef NPRINT
     if (b)
        cout << "Debug printout disabled, see the installation guide." << endl;
 #endif
+    
     flower_check_debug = b;
     flower_dstream = &ds;
 }
index 5674ca90a35dc9c728166b52a0d8cdb30394d12f..be5f56a7f06c7b8d0d62cf674023b52350cb7435 100644 (file)
    @return 4 components of the path. They can be empty
 */
 void
-split_path(String path, 
+split_path (String path, 
           String &drive, String &dirs, String &filebase, String &extension)
 {
     // peel off components, one by one.
-    int di = path.index_i(':');
+    int di = path.index_i (':');
     if (di >= 0) 
        {
-       drive = path.left_str(di + 1);
-       path = path.right_str(path.len() - di -1);
+       drive = path.left_str (di + 1);
+       path = path.right_str (path.len() - di -1);
        } 
     else
        drive = "";
     
-    di = path.index_last_i(PATHSEP);
+    di = path.index_last_i (PATHSEP);
     if (di >=0) 
        {
-       dirs = path.left_str(di + 1);
-       path = path.right_str(path.len()-di -1);
+       dirs = path.left_str (di + 1);
+       path = path.right_str (path.len()-di -1);
        }
     else
        dirs = "";
     
-    di = path.index_last_i('.');
+    di = path.index_last_i ('.');
     if (di >= 0) 
        {
-       filebase = path.left_str(di);
-       extension =path.right_str(path.len()-di);       
+       filebase = path.left_str (di);
+       extension =path.right_str (path.len()-di);      
        } 
     else 
        {
@@ -54,22 +54,25 @@ split_path(String path,
   in any other added path, in this order.
   */
 String
-File_path::find(String nm)const
+File_path::find (String nm)const
 
 {
     fdebug << "looking for " << nm << ": ";
-    if ( !nm.length_i() || ( nm == "-" ) )
+    if ( !nm.length_i() || ( nm == "-") )
        return nm;
     for (int i=0; i < size(); i++) {
 
-        String path  = (*this)[i];
-        path+= String(path.length_i()? "/":"")+nm;
+        String path  = elem(i);
+        if ( path.length_i() )
+            path += "/";
+        
+        path += nm;
 
         fdebug << path << "? ";
-        FILE *f = fopen(path.ch_C(), "r"); // ugh!
+        FILE *f = fopen (path.ch_C(), "r"); // ugh!
         if (f) {
             fdebug << "found\n";
-            fclose(f);
+            fclose (f);
             return path;
         }
      }