Diff for /embedaddon/php/sapi/cli/php_cli.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2012/05/29 12:34:35 version 1.1.1.3, 2013/07/22 01:32:13
Line 2 Line 2
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | PHP Version 5                                                        |     | PHP Version 5                                                        |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
   | Copyright (c) 1997-2012 The PHP Group                                |   | Copyright (c) 1997-2013 The PHP Group                                |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | This source file is subject to version 3.01 of the PHP license,      |     | This source file is subject to version 3.01 of the PHP license,      |
    | that is bundled with this package in the file LICENSE, and is        |     | that is bundled with this package in the file LICENSE, and is        |
Line 662  static int do_cli(int argc, char **argv TSRMLS_DC) /*  Line 662  static int do_cli(int argc, char **argv TSRMLS_DC) /* 
         int php_optind = 1, orig_optind = 1;          int php_optind = 1, orig_optind = 1;
         char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;          char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
         char *arg_free=NULL, **arg_excp=&arg_free;          char *arg_free=NULL, **arg_excp=&arg_free;
        char *script_file=NULL;        char *script_file=NULL, *translated_path = NULL;
         int interactive=0;          int interactive=0;
         int lineno = 0;          int lineno = 0;
         const char *param_error=NULL;          const char *param_error=NULL;
Line 687  static int do_cli(int argc, char **argv TSRMLS_DC) /*  Line 687  static int do_cli(int argc, char **argv TSRMLS_DC) /* 
                                 goto out;                                  goto out;
   
                         case 'v': /* show php version & quit */                          case 'v': /* show php version & quit */
                                php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2012 The PHP Group\n%s",                                php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2013 The PHP Group\n%s",
                                         PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__,                                          PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__,
 #if ZEND_DEBUG && defined(HAVE_GCOV)  #if ZEND_DEBUG && defined(HAVE_GCOV)
                                         "(DEBUG GCOV)",                                          "(DEBUG GCOV)",
Line 927  static int do_cli(int argc, char **argv TSRMLS_DC) /*  Line 927  static int do_cli(int argc, char **argv TSRMLS_DC) /* 
                 if (script_file) {                  if (script_file) {
                         if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) {                          if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) {
                                 goto err;                                  goto err;
                           } else {
                                   char real_path[MAXPATHLEN];
                                   if (VCWD_REALPATH(script_file, real_path)) {
                                           translated_path = strdup(real_path);
                                   }
                                   script_filename = script_file;
                         }                          }
                         script_filename = script_file;  
                 } else {                  } else {
                         /* We could handle PHP_MODE_PROCESS_STDIN in a different manner  */                          /* We could handle PHP_MODE_PROCESS_STDIN in a different manner  */
                         /* here but this would make things only more complicated. And it */                          /* here but this would make things only more complicated. And it */
Line 947  static int do_cli(int argc, char **argv TSRMLS_DC) /*  Line 952  static int do_cli(int argc, char **argv TSRMLS_DC) /* 
                 SG(request_info).argc=argc-php_optind+1;                  SG(request_info).argc=argc-php_optind+1;
                 arg_excp = argv+php_optind-1;                  arg_excp = argv+php_optind-1;
                 arg_free = argv[php_optind-1];                  arg_free = argv[php_optind-1];
                SG(request_info).path_translated = (char*)file_handle.filename;                SG(request_info).path_translated = translated_path? translated_path: (char*)file_handle.filename;
                 argv[php_optind-1] = (char*)file_handle.filename;                  argv[php_optind-1] = (char*)file_handle.filename;
                 SG(request_info).argv=argv+php_optind-1;                  SG(request_info).argv=argv+php_optind-1;
   
Line 1162  static int do_cli(int argc, char **argv TSRMLS_DC) /*  Line 1167  static int do_cli(int argc, char **argv TSRMLS_DC) /* 
         } zend_end_try();          } zend_end_try();
   
 out:  out:
         if (exit_status == 0) {  
                 exit_status = EG(exit_status);  
         }  
         if (request_started) {          if (request_started) {
                 php_request_shutdown((void *) 0);                  php_request_shutdown((void *) 0);
           }
           if (translated_path) {
                   free(translated_path);
           }
           if (exit_status == 0) {
                   exit_status = EG(exit_status);
         }          }
         return exit_status;          return exit_status;
 err:  err:

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>