Skip to content

Commit

Permalink
Merge branch 'PHP-8.1' into PHP-8.2
Browse files Browse the repository at this point in the history
* PHP-8.1:
  Fix bug GH-11246 cli/get_set_process_title
  • Loading branch information
iluuu1994 committed May 31, 2023
2 parents c33589e + c6ae7a5 commit 0bf8ecf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions NEWS
Expand Up @@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.2.8

- CLI:
. Fixed bug GH-11246 (cli/get_set_process_title fails on MacOS).
(James Lucas)

- Core:
. Fixed build for the riscv64 architecture/GCC 12. (Daniil Gentili)

Expand Down
15 changes: 7 additions & 8 deletions sapi/cli/ps_title.c
Expand Up @@ -169,19 +169,18 @@ char** save_ps_args(int argc, char** argv)
end_of_area = argv[i] + strlen(argv[i]);
}

if (!is_contiguous_area) {
goto clobber_error;
}

/*
* check for contiguous environ strings following argv
*/
for (i = 0; is_contiguous_area && (environ[i] != NULL); i++)
for (i = 0; environ[i] != NULL; i++)
{
if (end_of_area + 1 != environ[i]) {
is_contiguous_area = false;
if (end_of_area + 1 == environ[i]) {
end_of_area = environ[i] + strlen(environ[i]);
}
end_of_area = environ[i] + strlen(environ[i]);
}

if (!is_contiguous_area) {
goto clobber_error;
}

ps_buffer = argv[0];
Expand Down

0 comments on commit 0bf8ecf

Please sign in to comment.