On 03/18/2013 10:36 AM, Dmitry Stogov wrote:
Commit: 5b0879e7c969e0bd87b0ad6fad03e278a0a46642
Author: Dmitry Stogov <dmi...@zend.com> Mon, 18 Mar 2013 13:36:31
+0400
Parents: a9684532ebda83e2459da4f6f450a37f4ee6ff7b
Branches: PHP-5.5 master
Link:
http://git.php.net/?p=php-src.git;a=commitdiff;h=5b0879e7c969e0bd87b0ad6fad03e278a0a46642
Log:
Avoid trailing line break
Changed paths:
M ext/opcache/zend_accelerator_module.c
Diff:
diff --git a/ext/opcache/zend_accelerator_module.c
b/ext/opcache/zend_accelerator_module.c
index 019ce66..dd8eb59 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -403,6 +403,8 @@ static zval* accelerator_get_scripts(TSRMLS_D)
for (i = 0; i<ZCSG(hash).max_num_entries; i++) {
for (cache_entry = ZCSG(hash).hash_table[i]; cache_entry;
cache_entry = cache_entry->next) {
zend_persistent_script *script;
+ char *str;
+ int len;
could you use size_t instead of len? (strlen() returns size_t). Thanks :)
if (cache_entry->indirect) continue;
@@ -414,7 +416,10 @@ static zval* accelerator_get_scripts(TSRMLS_D)
add_assoc_long(persistent_script_report, "hits",
script->dynamic_members.hits);
add_assoc_long(persistent_script_report,
"memory_consumption", script->dynamic_members.memory_consumption);
ta = localtime(&script->dynamic_members.last_used);
- add_assoc_string(persistent_script_report, "last_used",
asctime(ta), 1);
+ str = asctime(ta);
+ len = strlen(str);
+ if (len > 0 && str[len - 1] == '\n') len--;
+ add_assoc_stringl(persistent_script_report,
"last_used", str, len, 1);
add_assoc_long(persistent_script_report,
"last_used_timestamp", script->dynamic_members.last_used);
if (ZCG(accel_directives).validate_timestamps) {
add_assoc_long(persistent_script_report,
"timestamp", (long)script->timestamp);
Andrey
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php