com php-src: Avoid trailing line break: ext/opcache/zend_acce lerator_module.c
| From: | Dmitry Stogov | Date: | Mon, 18 Mar 2013 09:36:31 +0000 |
| Subject: | com php-src: Avoid trailing line break: ext/opcache/zend_acce lerator_module.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71601@lists.php.net to get a copy of this message | ||
Commit: 5b0879e7c969e0bd87b0ad6fad03e278a0a46642
Author: Dmitry Stogov <dmitry@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;
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);