diff options
| author | Xinchen Hui <laruence@gmail.com> | 2016-05-01 11:04:48 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@gmail.com> | 2016-05-01 11:04:48 +0800 |
| commit | 6151151036592193159783d2225f88042b1966b1 (patch) | |
| tree | 9c7d580afdfe6ba406251e2c1e6395def0514c2a | |
| parent | 71df61adadfe276847167bd2f592c8196457c18d (diff) | |
| parent | 895337ddbdeb322da3c583ef7ea03b45d0c8282c (diff) | |
| download | php-git-6151151036592193159783d2225f88042b1966b1.tar.gz | |
Merge branch 'PHP-7.0'
| -rw-r--r-- | ext/posix/posix.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/posix/posix.c b/ext/posix/posix.c index e1f4ef6262..25cb26f372 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -987,8 +987,12 @@ int php_posix_group_to_array(struct group *g, zval *array_group) /* {{{ */ array_init(&array_members); add_assoc_string(array_group, "name", g->gr_name); - add_assoc_string(array_group, "passwd", g->gr_passwd); - for (count=0; g->gr_mem[count] != NULL; count++) { + if (array_group->gr_passwd) { + add_assoc_string(array_group, "passwd", g->gr_passwd); + } else { + add_assoc_null(array_group, "passwd"); + } + for (count = 0; g->gr_mem[count] != NULL; count++) { add_next_index_string(&array_members, g->gr_mem[count]); } zend_hash_str_update(Z_ARRVAL_P(array_group), "members", sizeof("members")-1, &array_members); |
