From: fred Date: Sun, 24 Mar 2002 20:05:38 +0000 (+0000) Subject: lilypond-0.1.44 X-Git-Tag: release/1.5.59~3443 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1ce2fb392b4fe7e6cb013ad747b4fbd25b339730;p=lilypond.git lilypond-0.1.44 --- diff --git a/flower/NEWS b/flower/NEWS index 1e795d59c3..06f5939f59 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,3 +1,6 @@ +pl 37 + - various String/File_path mucking + pl 36 - memmem fix: bugfree and *really* conforming to /usr/include/string.h diff --git a/flower/path.cc b/flower/path.cc index a499d0abf4..b9ed1c5320 100644 --- a/flower/path.cc +++ b/flower/path.cc @@ -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); +} diff --git a/flower/test/stringtest.cc b/flower/test/stringtest.cc index 79ec1e443a..4597ff3b85 100644 --- a/flower/test/stringtest.cc +++ b/flower/test/stringtest.cc @@ -8,18 +8,18 @@ #include "flower-test.hh" void -ctors() +ctors () { cout << "constructors"< a; - a.push("abcd"); - a.push("zxy"); - a.push("abc"); - a.push(""); - a.sort(String::compare_i); + a.push ("abcd"); + a.push ("zxy"); + a.push ("abc"); + a.push (""); + a.push ("a"); + a.sort (String::compare_i); cout << "compares: "<