Mercurial > hg > octave-nkf
diff src/graphics.cc @ 12449:2f0d1e12806d
invoke/terminate printing process synchronously with rendering (#32319)
author | Konstantinos Poulios <logari81@gmail.com> |
---|---|
date | Tue, 15 Feb 2011 18:49:13 +0100 |
parents | 98772e4e8a2a |
children | 68daf2a0b56d |
line wrap: on
line diff
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -7620,20 +7620,26 @@ if (! error_state) { - size_t pos = file.find_last_of (file_ops::dir_sep_chars ()); - - if (pos != std::string::npos) + size_t pos = file.find_first_not_of ("|"); + if (pos > 0) + file = file.substr (pos); + else { - std::string dirname = file.substr (0, pos+1); - - file_stat fs (dirname); - - if (! (fs && fs.is_dir ())) + pos = file.find_last_of (file_ops::dir_sep_chars ()); + + if (pos != std::string::npos) { - error ("drawnow: nonexistent directory `%s'", - dirname.c_str ()); - - return retval; + std::string dirname = file.substr (0, pos+1); + + file_stat fs (dirname); + + if (! (fs && fs.is_dir ())) + { + error ("drawnow: nonexistent directory `%s'", + dirname.c_str ()); + + return retval; + } } }