com php-src: basic EOL implementation for CRLF: phpdbg.c phpdbg_help.c phpdbg_prompt.c phpdbg_utils.c
| From: | Bob Weinand | Date: | Tue, 21 Oct 2014 13:50:55 +0000 |
| Subject: | com php-src: basic EOL implementation for CRLF: phpdbg.c phpdbg_help.c phpdbg_prompt.c phpdbg_utils.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82519@lists.php.net to get a copy of this message | ||
Commit: a741d3b266a6b6bfa668172d05f0f7460cf7ba00
Author: Anatol Belski <ab@php.net> Tue, 21 Oct 2014 15:50:55 +0200
Parents: 0f3448ef8bf7364e137ac52160c202e442bd4e52
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a741d3b266a6b6bfa668172d05f0f7460cf7ba00
Log:
basic EOL implementation for CRLF
Changed paths:
M phpdbg.c
M phpdbg_help.c
M phpdbg_prompt.c
M phpdbg_utils.c
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index 8686dcd..8831358 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -52,7 +52,7 @@ static PHP_INI_MH(OnUpdateEol)
return FAILURE;
}
- return phpdbg_update_eol_global(new_value TSRMLS_CC);
+ return phpdbg_eol_global_update(new_value TSRMLS_CC);
}
PHP_INI_BEGIN()
diff --git a/phpdbg_help.c b/phpdbg_help.c
index 8a7084b..652e170 100644
--- a/phpdbg_help.c
+++ b/phpdbg_help.c
@@ -22,6 +22,7 @@
#include "phpdbg.h"
#include "phpdbg_help.h"
#include "phpdbg_prompt.h"
+#include "phpdbg_eol.h"
#include "zend.h"
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index d72b1d5..7b09821 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -1570,10 +1570,10 @@ next:
PHPDBG_COMMAND(eol) /* {{{ */
{
if (!param || param->type == EMPTY_PARAM) {
- phpdbg_notice("eol", "argument required, supported crlf, lfcr, lf, cr",
"argument required, supported crlf, lfcr, lf, cr");
+ phpdbg_notice("eol", "argument required", "argument required");
} else switch (param->type) {
case STR_PARAM:
- if (FAILURE == phpdbg_update_eol_global(param->str TSRMLS_CC)) {
+ if (FAILURE == phpdbg_eol_global_update(param->str TSRMLS_CC)) {
phpdbg_notice("eol", "unknown EOL name '%s', give crlf, lfcr, lf,
cr", "unknown EOL name '%s', give crlf, lfcr, lf, cr", param->str);
}
break;
diff --git a/phpdbg_utils..c b/phpdbg_utils.c
index ecdb5fb..e1aeef2 100644
--- a/phpdbg_utils.c
+++ b/phpdbg_utils.c
@@ -1269,9 +1269,11 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char
*m
}
phpdbg_encode_ctrl_chars(&xmlout, &xmloutlen);
+ phpdbg_eol_convert(&xmlout, &xmloutlen TSRMLS_CC);
phpdbg_mixed_write(fd, xmlout, xmloutlen TSRMLS_CC);
efree(xmlout);
} else if (msgout) {
+ phpdbg_eol_convert(&msgout, &msgoutlen TSRMLS_CC);
phpdbg_mixed_write(fd, msgout, msgoutlen TSRMLS_CC);
}
@@ -1443,6 +1445,7 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) {
msglen = phpdbg_encode_xml(&msg, buffer, buflen, 256, NULL);
phpdbg_encode_ctrl_chars(&msg, &msglen);
+ phpdbg_eol_convert(&msg, &msglen TSRMLS_CC);
if (PHPDBG_G(in_script_xml)) {
phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC);
@@ -1453,6 +1456,7 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) {
len = phpdbg_mixed_write(fd, msg, msglen TSRMLS_CC);
phpdbg_mixed_write(fd, ZEND_STRL("</phpdbg>") TSRMLS_CC);
} else {
+ phpdbg_eol_convert(&buffer, &buflen TSRMLS_CC);
len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC);
}