# HG changeset patch # User John W. Eaton # Date 1259960702 18000 # Node ID 57b41617c9fdb9feeb22aa8617ac2fc60bb02e83 # Parent c1210502785ba5bcacfe0df00315506c1114248a avoid LIBCURL version check diff -r c1210502785b -r 57b41617c9fd src/ChangeLog --- a/src/ChangeLog Fri Dec 04 15:18:17 2009 -0500 +++ b/src/ChangeLog Fri Dec 04 16:05:02 2009 -0500 @@ -1,3 +1,8 @@ +2009-12-04 John W. Eaton + + * DLD-FUNCTIONS/urlwrite.cc (curl_handle::init): Always use + CURLOPT_USERPWD instead of CURLOPT_USER and CURLOPT_PASSWD. + 2009-12-04 John W. Eaton * version.h.in (OCTAVE_API_VERSION_NUMBER): New macro. diff -r c1210502785b -r 57b41617c9fd src/DLD-FUNCTIONS/urlwrite.cc --- a/src/DLD-FUNCTIONS/urlwrite.cc Fri Dec 04 15:18:17 2009 -0500 +++ b/src/DLD-FUNCTIONS/urlwrite.cc Fri Dec 04 16:05:02 2009 -0500 @@ -560,23 +560,10 @@ setopt (CURLOPT_NOBODY, 1); // Set the username and password -#if (LIBCURL_VERSION_NUM >= 0x071300) - // This is possible since cURL 7.19. - if (user.length () != 0) - setopt (CURLOPT_USERNAME, user.c_str()); - if (passwd.length () != 0) - setopt (CURLOPT_PASSWORD, passwd.c_str()); -#else - // Probably needs to be static to remain valid long enough. - static std::string userpwd; - if (user.length () != 0) - { - userpwd = user; - if (passwd.length () != 0) - userpwd += ':' + passwd; - setopt (CURLOPT_USERPWD, userpwd.c_str ()); - } -#endif + std::string userpwd = user; + if (! passwd.empty ()) + userpwd += ":" + passwd; + setopt (CURLOPT_USERPWD, userpwd.c_str ()); // Define our callback to get called when there's data to be written. setopt (CURLOPT_WRITEFUNCTION, write_data);