]> granicus.if.org Git - php/commitdiff
Turn interactive mode on, if cli binary is clicked in filemanager
authorAnatol Belski <ab@php.net>
Thu, 25 May 2017 19:01:32 +0000 (21:01 +0200)
committerAnatol Belski <ab@php.net>
Thu, 25 May 2017 19:04:56 +0000 (21:04 +0200)
sapi/cli/php_cli.c

index 0de93d80da86489c0b2963d469ceb65bb11ad496..ed66a8f9409462c7c22ce4f697ac793cc17e39b5 100644 (file)
@@ -674,7 +674,12 @@ static int do_cli(int argc, char **argv) /* {{{ */
        char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
        char *arg_free=NULL, **arg_excp=&arg_free;
        char *script_file=NULL, *translated_path = NULL;
+#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) && (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
+       DWORD pl[1];
+       int interactive = GetConsoleProcessList(pl, 1) == 1;
+#else
        int interactive=0;
+#endif
        int lineno = 0;
        const char *param_error=NULL;
        int hide_argv = 0;