summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2011-06-24 00:38:53 +0000
committerFelipe Pena <felipe@php.net>2011-06-24 00:38:53 +0000
commitbcf7e60d4cb7b64e6df7179f91a198ddbd2fb2ab (patch)
tree5244cf6588cd9440feec9516d40197107fd3622b
parent72f7be3df024b80544a647718aad73ed71c66d78 (diff)
downloadphp-git-bcf7e60d4cb7b64e6df7179f91a198ddbd2fb2ab.tar.gz
- Fixed build on Windows
-rw-r--r--Zend/zend_language_parser.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index e6f49a1595..3d774bff25 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -1150,7 +1150,8 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
{
TSRMLS_FETCH();
if (CG(parse_error) == 0) {
- char buffer[120], *end, *str, *tok1 = NULL, *tok2 = NULL;
+ char buffer[120];
+ const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
unsigned int len = 0, toklen = 0, yystr_len;
CG(parse_error) = 1;
@@ -1158,7 +1159,8 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
if (LANG_SCNG(yy_text)[0] == 0 &&
LANG_SCNG(yy_leng) == 1 &&
memcmp(yystr, ZEND_STRL("\"end of file\"")) == 0) {
- return yystpcpy(yyres, "end of file") - yyres;
+ yystpcpy(yyres, "end of file");
+ return sizeof("end of file")-1;
}
str = LANG_SCNG(yy_text);
@@ -1183,7 +1185,8 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
} else {
snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
}
- return yystpcpy(yyres, buffer) - yyres;
+ yystpcpy(yyres, buffer);
+ return len + (toklen ? toklen + 1 : 0) + 2;
}
}
if (*yystr == '"') {
@@ -1196,7 +1199,8 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
yyres[yyn] = '\0';
return yyn;
}
- return yystpcpy(yyres, yystr) - yyres;
+ yystpcpy(yyres, yystr);
+ return strlen(yystr);
}
/*