]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/path.cc
release: 0.1.44
[lilypond.git] / flower / path.cc
index a499d0abf4ee3d6572dffb8dbc145a8bf9d44c03..b9ed1c5320373920fc4e5fa7f23f8dc8e21e3ec5 100644 (file)
@@ -26,7 +26,7 @@ split_path (String path,
   if (di >= 0)
     {
       drive = path.left_str (di + 1);
-      path = path.right_str (path.len() - di -1);
+      path = path.right_str (path.length_i () - di -1);
     }
   else
     drive = "";
@@ -35,7 +35,7 @@ split_path (String path,
   if (di >=0)
     {
       dirs = path.left_str (di + 1);
-      path = path.right_str (path.len()-di -1);
+      path = path.right_str (path.length_i ()-di -1);
     }
   else
     dirs = "";
@@ -44,7 +44,7 @@ split_path (String path,
   if (di >= 0)
     {
       filebase = path.left_str (di);
-      extension =path.right_str (path.len()-di);
+      extension =path.right_str (path.length_i ()-di);
     }
   else
     {
@@ -77,7 +77,6 @@ File_path::parse_path (String p)
   */
 String
 File_path::find (String nm) const
-
 {
   fdebug << _("looking for ") << nm << ": ";
   if (!nm.length_i() || (nm == "-") )
@@ -85,8 +84,10 @@ File_path::find (String nm) const
   for (int i=0; i < size(); i++)
     {
       String path  = elem(i);
-      if (path.length_i() )
-       path += "/";
+      String sep (DIRSEP);
+      String right(path.right_str (1));
+      if (path.length_i () && right != sep)
+       path += DIRSEP;
 
       path += nm;
 
@@ -102,3 +103,9 @@ File_path::find (String nm) const
   fdebug << "\n";
   return "";
 }
+
+void
+File_path::add (String s)
+{
+   push (s); 
+}