]> granicus.if.org Git - php/commitdiff
don't compare constants on run time
authorAnatol Belski <ab@php.net>
Fri, 28 Feb 2014 18:38:32 +0000 (19:38 +0100)
committerAnatol Belski <ab@php.net>
Fri, 28 Feb 2014 18:38:32 +0000 (19:38 +0100)
ext/curl/interface.c

index 0d96d1f026efd22eb36a517c3296be377117f62c..09e20d3a67d2ecbdde3322abd95014b84b482d75 100644 (file)
@@ -169,16 +169,20 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str, const
 {
        CURLcode error = CURLE_OK;
 
-       if (make_copy || LIBCURL_VERSION_NUM < 0x071100) {
+#if LIBCURL_VERSION_NUM >= 0x071100
+       if (make_copy) {
+#endif
                char *copystr;
 
                /* Strings passed to libcurl as 'char *' arguments, are copied by the library since 7.17.0 */
                copystr = estrndup(str, len);
                error = curl_easy_setopt(ch->cp, option, copystr);
                zend_llist_add_element(&ch->to_free->str, &copystr);
+#if LIBCURL_VERSION_NUM >= 0x071100
        } else {
                error = curl_easy_setopt(ch->cp, option, str);
        }
+#endif
 
        SAVE_CURL_ERROR(ch, error)