com php-src: allow setting both ports from command line:: phpdbg.c

From: Date: Fri, 29 Nov 2013 18:55:15 +0000
Subject: com php-src: allow setting both ports from command line:: phpdbg.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75360@lists.php.net to get a copy of this message
Commit: 41f93d4c15dee82dcbc0edb7603b4a70c970f4f0 Author: krakjoe <joe.watkins@live.co.uk> Fri, 29 Nov 2013 18:55:15 +0000 Parents: c56a25b50af58a77511f5d0dab740efe2552d0d5 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=41f93d4c15dee82dcbc0edb7603b4a70c970f4f0 Log: allow setting both ports from command line: Changed paths: M phpdbg.c Diff: diff --git a/phpdbg.c b/phpdbg.c index f04d694..2cedaf4 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -873,12 +873,18 @@ phpdbg_main: /* if you pass a listen port, we will accept input on listen port */ /* and write output to listen port * 2 */ - case 'l': /* set listen settings */ - listen[0] = atoi(php_optarg); - listen[1] = (listen[0] * 2); - break; + case 'l': { /* set listen settings */ + if (sscanf(php_optarg, "%d/%d", &listen[0], &listen[1]) != 2) { + if (sscanf(php_optarg, "%d", &listen[0]) != 1) { + /* default to hardcoded ports */ + listen[0] = 4000; + listen[1] = 8000; + } else { + listen[1] = (listen[0] * 2); + } + } + } break; #endif - } }

« previous php.cvs (#75360) next »