]> granicus.if.org Git - php/commitdiff
Fixed bug #39878 (CURL doesn't compile on Sun Studio Pro).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 26 Dec 2006 16:55:56 +0000 (16:55 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 26 Dec 2006 16:55:56 +0000 (16:55 +0000)
NEWS
ext/curl/interface.c

diff --git a/NEWS b/NEWS
index cff14aad7ab6e4d07b209eb8a07ca36abca0232c..0ad9ddafdf5a164ad3f52e11dc5bea0b0cb902d7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ PHP                                                                        NEWS
   install path). (Tony)
 - Fixed bug #39884 (ReflectionParameter::getClass() throws exception for type
   hint self). (thekid at php dot net)
+- Fixed bug #39878 (CURL doesn't compile on Sun Studio Pro). (Ilia)
 - Fixed bug #39873 (number_format() breaks with locale & decimal points).
   (Ilia)
 - Fixed bug #39869 (safe_read does not initialize errno).
index 54e5f46e2caa5544edaa54c533641d745b33bd7a..2ec184dd47c25432ac0467ccbbf81d21df6e7fa3 100644 (file)
@@ -156,6 +156,12 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
 #define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s), (char *) v, 1);
 #define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s), (zval *) v);
 
+#if defined(PHP_WIN32) || defined(__GNUC__)
+ #define php_curl_ret(__ret) RETVAL_FALSE; return __ret;
+#else
+ #define php_curl_ret(__ret) RETVAL_FALSE; return;
+#endif
+
 #define PHP_CURL_CHECK_OPEN_BASEDIR(str, len, __ret)                                                                                                   \
        if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) &&                                                \
            strncasecmp(str, "file:", sizeof("file:") - 1) == 0)                                                                \
@@ -164,22 +170,19 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
                                                                                                                        \
                if (!(tmp_url = php_url_parse_ex(str, len))) {                                                                                  \
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", str);                           \
-                       RETVAL_FALSE;                                                                                   \
-                       return __ret;                                                                                   \
-               }                                                                                                                                                                               \
+                       php_curl_ret(__ret);                                                                                    \
+               }                                                                                                       \
                                                                                                                        \
                if (php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) {                                \
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL '%s' contains unencoded control characters.", str);    \
-                       RETVAL_FALSE;                                                                                   \
-                       return __ret;                                                                                   \
+                       php_curl_ret(__ret);                                                                                    \
                }                                                                                                       \
                                                                                                                                                                                                \
                if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC) ||                                                                   \
                        (PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM))       \
                ) {                                                                                                                                                                     \
                        php_url_free(tmp_url);                                                                                                                          \
-                       RETVAL_FALSE;                                                                                   \
-                       return __ret;                                                                                   \
+                       php_curl_ret(__ret);                                                                                    \
                }                                                                                                                                                                               \
                php_url_free(tmp_url);                                                                                                                                  \
        }