Mercurial > hg > octave-lojdl
changeset 13978:a33ec41d0340
Fix error reporting in urlwrite (bug #34971)
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Fri, 02 Dec 2011 18:50:56 -0500 |
parents | 08ae07e40d4f |
children | f35b593688a5 |
files | src/DLD-FUNCTIONS/urlwrite.cc |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/urlwrite.cc +++ b/src/DLD-FUNCTIONS/urlwrite.cc @@ -805,8 +805,8 @@ frame.add_fcn (cleanup_urlwrite, filename); - bool res; - curl_handle curl = curl_handle (url, method, param, ofile, res); + bool ok; + curl_handle curl = curl_handle (url, method, param, ofile, ok); ofile.close (); @@ -817,7 +817,7 @@ if (nargout > 0) { - if (res) + if (ok) { retval(2) = std::string (); retval(1) = true; @@ -831,7 +831,7 @@ } } - if (nargout < 2 && res) + if (nargout < 2 && ! ok) error ("urlwrite: curl: %s", curl.lasterror ().c_str ()); #else @@ -939,18 +939,18 @@ std::ostringstream buf; - bool res; - curl_handle curl = curl_handle (url, method, param, buf, res); + bool ok; + curl_handle curl = curl_handle (url, method, param, buf, ok); if (nargout > 0) { retval(0) = buf.str (); - retval(1) = res; + retval(1) = ok; // Return empty string if no error occured. - retval(2) = res ? "" : curl.lasterror (); + retval(2) = ok ? "" : curl.lasterror (); } - if (nargout < 2 && !res) + if (nargout < 2 && ! ok) error ("urlread: curl: %s", curl.lasterror().c_str()); #else