Re: [PHP-CVS] com php-src: Fix conversion from unsigned char to char: sapi/cgi/cgi_main.c
On 04/29/2013 12:49 AM, Stas Malyshev wrote: > Hi! > >> Are you sure about this change? >> Because this actually changes the semantics of the code. The following piece >> of code will now evaluate differently than before: >> *p <= ' ' > > I also don't understand this change - this means 0xFF would now be > skipped as space while before it was not. Is it the intended effect? > I reverted the change to make I dont break anything. The better option would probably use the char * as it's passed and check for *p >= \0 && *p <= ' ', David -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fix conversion from unsigned char to char: sapi/cgi/cgi_main.c
Hi! > Are you sure about this change? > Because this actually changes the semantics of the code. The following piece > of code will now evaluate differently than before: > *p <= ' ' I also don't understand this change - this means 0xFF would now be skipped as space while before it was not. Is it the intended effect? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fix conversion from unsigned char to char: sapi/cgi/cgi_main.c
Are you sure about this change? Because this actually changes the semantics of the code. The following piece of code will now evaluate differently than before: *p <= ' ' Nuno -Original Message- From: David Soria Parra Sent: Friday, April 26, 2013 9:55 AM To: php-cvs@lists.php.net Subject: [PHP-CVS] com php-src: Fix conversion from unsigned char to char: sapi/cgi/cgi_main.c Commit:bc50ba4bf971c62a1ff5b915a0c9f890b04c1087 Author:David Soria Parra Fri, 26 Apr 2013 10:55:52 +0200 Parents: 75cec90d8cc2ea34ab9e5e7146cb6b3bf29430a9 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bc50ba4bf971c62a1ff5b915a0c9f890b04c1087 Log: Fix conversion from unsigned char to char Changed paths: M sapi/cgi/cgi_main.c Diff: diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 9e6b74a..abe5e6b 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1818,7 +1818,7 @@ int main(int argc, char *argv[]) if((query_string = getenv("QUERY_STRING")) != NULL && strchr(query_string, '=') == NULL) { /* we've got query string that has no = - apache CGI will pass it to command line */ - unsigned char *p; + char *p; decoded_query_string = strdup(query_string); php_url_decode(decoded_query_string, strlen(decoded_query_string)); for (p = decoded_query_string; *p && *p <= ' '; p++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix conversion from unsigned char to char: sapi/cgi/cgi_main.c
Commit:bc50ba4bf971c62a1ff5b915a0c9f890b04c1087 Author:David Soria Parra Fri, 26 Apr 2013 10:55:52 +0200 Parents: 75cec90d8cc2ea34ab9e5e7146cb6b3bf29430a9 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bc50ba4bf971c62a1ff5b915a0c9f890b04c1087 Log: Fix conversion from unsigned char to char Changed paths: M sapi/cgi/cgi_main.c Diff: diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 9e6b74a..abe5e6b 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1818,7 +1818,7 @@ int main(int argc, char *argv[]) if((query_string = getenv("QUERY_STRING")) != NULL && strchr(query_string, '=') == NULL) { /* we've got query string that has no = - apache CGI will pass it to command line */ - unsigned char *p; + char *p; decoded_query_string = strdup(query_string); php_url_decode(decoded_query_string, strlen(decoded_query_string)); for (p = decoded_query_string; *p && *p <= ' '; p++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php