From 110f05277c4192239e4ce3014935bb1e8865a6ec Mon Sep 17 00:00:00 2001 From: Drew Paroski Date: Mon, 20 May 2013 18:51:17 -0700 Subject: [PATCH] Fix hphpd to not raise a notice when no file is given at the command line "hhvm -m debug" without specifying a file should work without raising notices. hphp_invoke_simple() and friends used to (incorrectly) tolerate using an empty string for the file name, and hphpd was relying on this. This diff fixes hphpd to not call hphp_invoke_simple() when no file was given at the command line. --- hphp/runtime/eval/debugger/debugger.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hphp/runtime/eval/debugger/debugger.cpp b/hphp/runtime/eval/debugger/debugger.cpp index 9d32141b4..3273fd9fd 100644 --- a/hphp/runtime/eval/debugger/debugger.cpp +++ b/hphp/runtime/eval/debugger/debugger.cpp @@ -143,7 +143,9 @@ void Debugger::DebuggerSession(const DebuggerClientOptions& options, DebuggerDummyEnv dde; Debugger::InterruptSessionStarted(file.c_str()); } - hphp_invoke_simple(file); + if (!file.empty()) { + hphp_invoke_simple(file); + } { DebuggerDummyEnv dde; Debugger::InterruptSessionEnded(file.c_str());