Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24118 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38609 invoked by uid 1010); 14 Jun 2006 02:05:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38594 invoked from network); 14 Jun 2006 02:05:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2006 02:05:18 -0000 X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:6374] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 0C/70-00253-DDE6F844 for ; Tue, 13 Jun 2006 22:05:17 -0400 Received: from foxbox (IGLD-84-229-192-204.inter.net.il [84.229.192.204]) by gw2.emini.dk (Postfix) with ESMTP id 6BDFBB6446 for ; Wed, 14 Jun 2006 04:05:12 +0200 (CEST) Message-ID: <222a01c68f56$922d7590$6602a8c0@foxbox> Reply-To: "Steph Fox" To: "internals" Date: Wed, 14 Jun 2006 04:02:19 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_2227_01C68F67.54E512E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: [PATCH] sane fix for "php -c" when users do it all wrong From: steph@zend.com ("Steph Fox") ------=_NextPart_000_2227_01C68F67.54E512E0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Please can someone either apply this or give me a good reason not to? Diffs are against PHP_5_2. Please say if you need them specifically for other branches. - Steph ------=_NextPart_000_2227_01C68F67.54E512E0 Content-Type: text/plain; format=flowed; name="CLI_CGI_fix.txt"; reply-type=original Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="CLI_CGI_fix.txt" Index: sapi/cgi/cgi_main.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/sapi/cgi/cgi_main.c,v=0A= retrieving revision 1.267.2.15.2.4=0A= diff -u -r1.267.2.15.2.4 cgi_main.c=0A= --- sapi/cgi/cgi_main.c 3 Jun 2006 22:02:02 -0000 1.267.2.15.2.4=0A= +++ sapi/cgi/cgi_main.c 13 Jun 2006 19:05:38 -0000=0A= @@ -1047,6 +1047,10 @@=0A= while ((c =3D php_getopt(argc, argv, OPTIONS, &php_optarg, = &php_optind, 0)) !=3D -1) {=0A= switch (c) {=0A= case 'c':=0A= + if (argc =3D=3D php_optind || strchr(php_optarg, '-') !=3D NULL) {=0A= + printf("You need to give the path to php.ini after -c.\n");=0A= + exit(0);=0A= + }=0A= cgi_sapi_module.php_ini_path_override =3D strdup(php_optarg);=0A= break;=0A= case 'n':=0A= Index: sapi/cli/php_cli.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/sapi/cli/php_cli.c,v=0A= retrieving revision 1.129.2.13.2.3=0A= diff -u -r1.129.2.13.2.3 php_cli.c=0A= --- sapi/cli/php_cli.c 3 Jun 2006 22:02:02 -0000 1.129.2.13.2.3=0A= +++ sapi/cli/php_cli.c 13 Jun 2006 19:03:58 -0000=0A= @@ -640,6 +640,11 @@=0A= while ((c =3D php_getopt(argc, argv, OPTIONS, &php_optarg, = &php_optind, 0))!=3D-1) {=0A= switch (c) {=0A= case 'c':=0A= + if (argc =3D=3D php_optind || strchr(php_optarg, '-') !=3D NULL) {=0A= + printf("You need to give the path to php.ini after -c.\n");=0A= + exit_status =3D 1;=0A= + goto out_err;=0A= + }=0A= cli_sapi_module.php_ini_path_override =3D strdup(php_optarg);=0A= break;=0A= case 'n':=0A= ------=_NextPart_000_2227_01C68F67.54E512E0--