com php-src: Port for for bug #68552: ext/enchant/enchant.c
| From: | JulienPauli | Date: | Wed, 18 Feb 2015 10:31:47 +0000 |
| Subject: | com php-src: Port for for bug #68552: ext/enchant/enchant.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84979@lists.php.net to get a copy of this message | ||
Commit: 68ca18215bfc551ee04f47534b56c65999e7ba42
Author: Stanislav Malyshev <stas@php.net> Mon, 16 Feb 2015 06:50:10 +0100
Committer: Julien Pauli <jpauli@php.net> Wed, 18 Feb 2015 11:31:47 +0100
Parents: 51cd5a1d09ce3dd3027eace601661a2bc5745851
Branches: PHP-5.5.22
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=68ca18215bfc551ee04f47534b56c65999e7ba42
Log:
Port for for bug #68552
Bugs:
https://bugs.php.net/68552
Changed paths:
M ext/enchant/enchant.c
Diff:
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index 6ec02cd..d7c115e 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -550,13 +550,12 @@ PHP_FUNCTION(enchant_broker_request_dict)
d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
if (d) {
+ pos = pbroker->dictcnt++;
if (pbroker->dictcnt) {
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) *
pbroker->dictcnt);
- pos = pbroker->dictcnt++;
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
- pbroker->dictcnt++;
}
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
@@ -607,14 +606,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
if (d) {
+ pos = pbroker->dictcnt++;
if (pbroker->dictcnt) {
- pos = pbroker->dictcnt++;
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) *
pbroker->dictcnt);
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
- pbroker->dictcnt++;
}
+
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
dict->id = pos;
dict->pbroker = pbroker;