Bug 12781 – process.d: "Executable file not found" is supposed to show executable name but fails
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2014-05-21T20:37:00Z
Last change time
2014-07-11T17:15:05Z
Assigned to
nobody
Creator
van.de.bugger
Comments
Comment #0 by van.de.bugger — 2014-05-21T20:37:01Z
Look at file phobos/std/process.d line ~360, it is the very beginning of
function spawnProcessImpl:
const(char)[] name = args[0];
if (any!isDirSeparator(name))
{
if (!isExecutable(name))
throw new ProcessException(text("Not an executable
file: ", name));
}
else
{
name = searchPathFor(name);
if (name is null)
throw new ProcessException(text("Executable file not
found: ", name));
}
Look at the "else" clause. If function searchPathFor failed, we
are throwing an error "Executable file not found: ", which is
supposed to include name of executable file. But name at this
moment is null... :-(
Comment #1 by justin — 2014-07-11T17:15:05Z
Fixed in git head by commit 0812ecd1f6519028070eba0c9b4504bded48a7a5