mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 14:10:30 +03:00
Improve searchPathFor
This commit is contained in:
parent
3e2b615b8d
commit
52304683d7
1 changed files with 3 additions and 3 deletions
|
@ -1498,10 +1498,10 @@ package(std) string searchPathFor(scope const(char)[] executable)
|
||||||
@safe
|
@safe
|
||||||
{
|
{
|
||||||
import std.algorithm.iteration : splitter;
|
import std.algorithm.iteration : splitter;
|
||||||
import std.conv : text;
|
import std.conv : to;
|
||||||
import std.path : chainPath;
|
import std.path : chainPath;
|
||||||
|
|
||||||
string result;
|
typeof(return) result;
|
||||||
|
|
||||||
environment.getImpl("PATH",
|
environment.getImpl("PATH",
|
||||||
(scope const(char)[] path)
|
(scope const(char)[] path)
|
||||||
|
@ -1514,7 +1514,7 @@ package(std) string searchPathFor(scope const(char)[] executable)
|
||||||
auto execPath = chainPath(dir, executable);
|
auto execPath = chainPath(dir, executable);
|
||||||
if (isExecutable(execPath))
|
if (isExecutable(execPath))
|
||||||
{
|
{
|
||||||
result = text(execPath);
|
result = execPath.to!(typeof(result));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue