File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -4966,12 +4966,14 @@ PHP_FUNCTION(uv_exepath)
49664966*/
49674967PHP_FUNCTION (uv_cwd )
49684968{
4969- char buffer [1024 ] = {0 };
4970- size_t buffer_sz = sizeof (buffer );
4971-
4972- uv_cwd (buffer , buffer_sz );
4973- buffer [buffer_sz ] = '\0' ;
4974-
4969+ char buffer [MAXPATHLEN ];
4970+
4971+ if (zend_parse_parameters_none () == FAILURE ) {
4972+ return ;
4973+ }
4974+
4975+ uv_cwd (buffer , MAXPATHLEN );
4976+
49754977 RETURN_STRING (buffer , 1 );
49764978}
49774979/* }}} */
Original file line number Diff line number Diff line change 22Check for uv_chdir
33--FILE--
44<?php
5- @ uv_chdir (); // don't SEGV
5+ uv_chdir (); // don't SEGV
66
77uv_chdir (dirname (__FILE__ ));
88if (uv_cwd () == dirname (__FILE__ )) {
@@ -11,5 +11,7 @@ if (uv_cwd() == dirname(__FILE__)) {
1111 echo "FAILED: expected " . dirname (__FILE__ ) . ", but " . uv_cwd ();
1212}
1313
14- --EXPECT --
15- OK
14+ --EXPECTF --
15+
16+ Warning: uv_chdir() expects exactly 1 parameter, 0 given in %s on line %d
17+ OK
You can’t perform that action at this time.
0 commit comments