mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 05:30:33 +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
|
||||
{
|
||||
import std.algorithm.iteration : splitter;
|
||||
import std.conv : text;
|
||||
import std.conv : to;
|
||||
import std.path : chainPath;
|
||||
|
||||
string result;
|
||||
typeof(return) result;
|
||||
|
||||
environment.getImpl("PATH",
|
||||
(scope const(char)[] path)
|
||||
|
@ -1514,7 +1514,7 @@ package(std) string searchPathFor(scope const(char)[] executable)
|
|||
auto execPath = chainPath(dir, executable);
|
||||
if (isExecutable(execPath))
|
||||
{
|
||||
result = text(execPath);
|
||||
result = execPath.to!(typeof(result));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue