# HG changeset patch # User John W. Eaton # Date 1233871449 18000 # Node ID f3579c1d6be98365af149dd00b966b3a3d94915d # Parent dd13355fc98a68cddca4bb82285e12b113b35271 Fdrawnow: don't strip dirsep; return after errors diff -r dd13355fc98a -r f3579c1d6be9 src/ChangeLog --- a/src/ChangeLog Thu Feb 05 13:46:47 2009 -0500 +++ b/src/ChangeLog Thu Feb 05 17:04:09 2009 -0500 @@ -1,5 +1,8 @@ 2009-02-05 John W. Eaton + * graphics.cc (Fdrawnow): Return after errors. Don't strip + trailing directory separator from name used in call to file_stat. + * DLD-FUNCTIONS/eigs.cc (Feigs): Avoid warnings about ambiguous else. Style fixes. Return after errors. diff -r dd13355fc98a -r f3579c1d6be9 src/graphics.cc --- a/src/graphics.cc Thu Feb 05 13:46:47 2009 -0500 +++ b/src/graphics.cc Thu Feb 05 17:04:09 2009 -0500 @@ -4984,7 +4984,10 @@ if (! error_state && val.compare ("expose")) do_events = false; else - error ("drawnow: invalid argument, expected `expose' as argument"); + { + error ("drawnow: invalid argument, expected `expose' as argument"); + return retval; + } } if (do_events) @@ -5013,11 +5016,17 @@ if (pos != std::string::npos) { - file_stat fs (file.substr (0, pos)); + std::string dirname = file.substr (0, pos+1); + + file_stat fs (dirname); if (! (fs && fs.is_dir ())) - error ("drawnow: nonexistent directory `%s'", - file.substr (0, pos).c_str ()); + { + error ("drawnow: nonexistent directory `%s'", + dirname.c_str ()); + + return retval; + } } mono = (args.length () >= 3 ? args(2).bool_value () : false);