# HG changeset patch # User John W. Eaton # Date 1454828638 18000 # Node ID 7be1f58f9dd72519917abcf2c460abfe6472bda3 # Parent f7d1050b9b5331433ace013874a3659ae962211d don't strip pipe character from command in drawnow function * graphics.cc (Fdrawnow): Don't strip pipe character in command before passing to toolkit print function. Only check first character in command string for pipe character. diff -r f7d1050b9b53 -r 7be1f58f9dd7 libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sat Feb 06 18:22:32 2016 -0800 +++ b/libinterp/corefcn/graphics.cc Sun Feb 07 02:03:58 2016 -0500 @@ -10763,26 +10763,17 @@ file = args(1).xstring_value ("drawnow: FILE must be a string"); - size_t pos_p = file.find_first_of ("|"); - size_t pos_c = file.find_first_not_of ("| "); - - if (pos_p == std::string::npos && - pos_c == std::string::npos) + if (file.empty ()) error ("drawnow: empty output ''"); - else if (pos_c == std::string::npos) + else if (file.length () == 1 && file[0] == '|') error ("drawnow: empty pipe '|'"); - else if (pos_p != std::string::npos && pos_p < pos_c) - { - // Strip leading pipe character - file = file.substr (pos_c); - } - else + else if (file[0] != '|') { size_t pos = file.find_last_of (file_ops::dir_sep_chars ()); if (pos != std::string::npos) { - std::string dirname = file.substr (pos_c, pos+1); + std::string dirname = file.substr (0, pos+1); file_stat fs (dirname);