# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1322869856 18000 # Node ID a33ec41d0340951c631c2818a91d195f50e7fa9b # Parent 08ae07e40d4f7436880766d9f9a44d5a58e3e4ca Fix error reporting in urlwrite (bug #34971) diff --git a/src/DLD-FUNCTIONS/urlwrite.cc b/src/DLD-FUNCTIONS/urlwrite.cc --- 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