Mercurial > hg > octave-lyh
diff libinterp/octave-value/ov-java.cc @ 15798:ac9e34f83522
Allow one char paths, like '/', in javaclasspath.txt
* libinterp/octave-value/ov-java.cc(read_classpath.txt): Process line
if length is > 0, not 1. Eliminate CamelCase variable iLast. Trim all
whitespace from path before adding to static classpath.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 15 Dec 2012 22:47:26 -0800 |
parents | 492893b98eef |
children | d9b8333df5e4 |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-java.cc +++ b/libinterp/octave-value/ov-java.cc @@ -293,19 +293,19 @@ { std::getline (fs, line); - if (line.length () > 1) + if (line.length () > 0) { - if (line.at(0) == '#' || line.at(0) == '%') + if (line[0] == '#' || line[0] == '%') ; // skip comments else { // prepend separator character classpath.append (dir_path::path_sep_str ()); - // append content of line without trailing blanks - int iLast = line.find_last_not_of (' '); + // append content of line without whitespace + int last = line.find_last_not_of (" \t\f\v\r\n"); - classpath.append (file_ops::tilde_expand (line.substr (0, iLast+1))); + classpath.append (file_ops::tilde_expand (line.substr (0, last+1))); } } } @@ -314,7 +314,6 @@ return (classpath); } - static std::string initial_class_path (void) {