com php-src: Fix execution of immediately following commands: phpdbg_cmd.c phpdbg_utils.c

From: Date: Sat, 18 Oct 2014 18:42:54 +0000
Subject: com php-src: Fix execution of immediately following commands: phpdbg_cmd.c phpdbg_utils.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82554@lists.php.net to get a copy of this message
Commit: bdb18d9f48831cd31d42d3f0d8915c5aa5fe0f8e Author: Bob Weinand <bobwei9@hotmail.com> Sat, 18 Oct 2014 20:42:54 +0200 Parents: 24972fa986f316bc64141f46ff37f1a33ae03624 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bdb18d9f48831cd31d42d3f0d8915c5aa5fe0f8e Log: Fix execution of immediately following commands Changed paths: M phpdbg_cmd.c M phpdbg_utils.c Diff: diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index ad49c62..d42ad36 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -829,12 +829,12 @@ readline: #endif { char buf[PHPDBG_MAX_CMD]; - int bytes = 0, len = PHPDBG_G(input_buflen); + int bytes = PHPDBG_G(input_buflen), len = 0; if (PHPDBG_G(input_buflen)) { - memcpy(buf, PHPDBG_G(input_buffer), len); + memcpy(buf, PHPDBG_G(input_buffer), bytes); } - while ((bytes = read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len)) > 0 || (errno == EINTR && bytes < 0)) { + do { int i; if (bytes <= 0) { continue; @@ -862,7 +862,7 @@ readline: } } len += bytes; - } + } while ((bytes = read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len)) > 0 || (errno == EINTR && bytes < 0)); if (bytes <= 0) { goto disconnect; diff --git a/phpdbg_utils.c b/phpdbg_utils.c index 5f94d21..ca36f10 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -1103,7 +1103,7 @@ static void phpdbg_encode_ctrl_chars(char **buf, int *buflen) { len += 4; *tmpptr++ = '&'; *tmpptr++ = '#'; - if ((unsigned int) ((*buf)[i]) > 10) { + if ((unsigned int) ((*buf)[i]) > 9) { *tmpptr++ = ((*buf)[i] / 10) + '0'; } else { --len;

« previous php.cvs (#82554) next »