Skip to content

Commit

Permalink
Merge branch 'xdebug_3_2'
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Jul 26, 2023
2 parents 0e18ec5 + b249ff9 commit abc6272
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/lib/usefulstuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ FILE *xdebug_fopen(char *fname, const char *mode, const char *extension, char **
int xdebug_format_output_filename(char **filename, char *format, char *script_name)
{
xdebug_str fname = XDEBUG_STR_INITIALIZER;
char cwd[128];
char cwd[MAXPATHLEN];

while (*format)
{
Expand All @@ -507,7 +507,7 @@ int xdebug_format_output_filename(char **filename, char *format, char *script_na
switch (*format)
{
case 'c': /* crc32 of the current working directory */
if (VCWD_GETCWD(cwd, 127)) {
if (VCWD_GETCWD(cwd, MAXPATHLEN - 1)) {
xdebug_str_add_fmt(&fname, "%lu", xdebug_crc32(cwd, strlen(cwd)));
}
break;
Expand Down
13 changes: 2 additions & 11 deletions tests/develop/error_collection-001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,11 @@ xdebug_start_error_collection();

trigger_error("An error", E_USER_WARNING);

echo "Errors\n";
var_dump( xdebug_get_collected_errors() );
echo xdebug_get_collected_errors()[0];
?>
--EXPECTF--
Errors
%serror_collection-001.php:7:
array(1) {
[0] =>
string(%d) "
Warning: An error in %serror_collection-001.php on line 4

Call Stack:
%w%f %w%d 1. {main}() %serror_collection-001.php:0
%w%f %w%d 2. trigger_error($message = 'An error', $error_%s = 512) %serror_collection-001.php:4

"
}
%w%f %w%d 2. trigger_error($message = 'An error', $error_%s = 512) %A
2 changes: 1 addition & 1 deletion xdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ ZEND_DLEXPORT int xdebug_zend_startup(zend_extension *extension)
return zend_startup_module(&xdebug_module_entry);
}

static int xdebug_post_startup(void)
static zend_result xdebug_post_startup(void)
{
if (xdebug_orig_post_startup_cb) {
int (*cb)(void) = xdebug_orig_post_startup_cb;
Expand Down

0 comments on commit abc6272

Please sign in to comment.