diff libinterp/corefcn/urlwrite.cc @ 18329:b522d04382cf stable

Return all nargout from urlread if requested (bug #41260). * urlwrite.cc (Furlread): Assign all outputs to retval when nargout > 0.
author Rik <rik@octave.org>
date Wed, 22 Jan 2014 10:37:35 -0800
parents 9a43d8d6e29e
children af04b9d9f7ed
line wrap: on
line diff
--- a/libinterp/corefcn/urlwrite.cc	Wed Jan 22 02:49:29 2014 -0500
+++ b/libinterp/corefcn/urlwrite.cc	Wed Jan 22 10:37:35 2014 -0800
@@ -554,15 +554,12 @@
     {
       curl.http_action (param, method);
 
-      if (curl.good ())
+      if (nargout > 0)
         {
-          if (nargout > 0)
-            {
-              // Return empty string if no error occured.
-              retval(2) = curl.good () ? "" : curl.lasterror ();
-              retval(1) = curl.good ();
-              retval(0) = buf.str ();
-            }
+          // Return empty string if no error occured.
+          retval(2) = curl.good () ? "" : curl.lasterror ();
+          retval(1) = curl.good ();
+          retval(0) = buf.str ();
         }
 
       if (nargout < 2 && ! curl.good ())