diff options
Diffstat (limited to 'sapi/phpdbg/phpdbg_out.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_out.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c index 545e1c951d..665df6d08b 100644 --- a/sapi/phpdbg/phpdbg_out.c +++ b/sapi/phpdbg/phpdbg_out.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -114,13 +114,8 @@ typedef struct buf_area buffy; */ #define PREFIX( str, length, ch ) *--str = ch ; length++ ; has_prefix = YES - -#ifdef HAVE_LOCALE_H #include <locale.h> #define LCONV_DECIMAL_POINT (*lconv->decimal_point) -#else -#define LCONV_DECIMAL_POINT '.' -#endif #define NUL '\0' #define S_NULL "(null)" #define S_NULL_LEN 6 @@ -155,9 +150,7 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca char num_buf[NUM_BUF_SIZE]; char char_buf[2]; /* for printing %% and %<unknown> */ -#ifdef HAVE_LOCALE_H struct lconv *lconv = NULL; -#endif /* * Flag variables @@ -621,11 +614,10 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca s = "INF"; s_len = 3; } else { -#ifdef HAVE_LOCALE_H if (!lconv) { lconv = localeconv(); } -#endif + s = php_conv_fp((*fmt == 'f')?'F':*fmt, fp_num, alternate_form, (adjust_precision == NO) ? FLOAT_DIGITS : precision, (*fmt == 'f')?LCONV_DECIMAL_POINT:'.', @@ -678,11 +670,10 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca /* * * We use &num_buf[ 1 ], so that we have room for the sign */ -#ifdef HAVE_LOCALE_H if (!lconv) { lconv = localeconv(); } -#endif + s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]); if (*s == '-') { prefix_char = *s++; @@ -872,17 +863,6 @@ PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool es } /* copy end */ -PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...) { - int ret; - va_list va; - - va_start(va, escape_xml); - ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va); - va_end(va); - - return ret; -} - PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...) { int ret; va_list va; @@ -1039,9 +1019,8 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m } else { phpdbg_mixed_write(fd, msg, msglen); } - return msglen; } - break; + return msglen; /* no formatting on logging output */ case P_LOG: @@ -1055,6 +1034,7 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m } } break; + EMPTY_SWITCH_DEFAULT_CASE() } if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { |