Uh oh!
There was an error while loading. Please reload this page.
#14146: Iterate PATH when no /usr/bin/env - #18828
Conversation
I will be adding similar kind of code to ElfDynLib to find system libraries as well. Maybe we could add utility like this to std.fs or std.os ? constSearchPathIterator=struct {
paths: std.mem.TokenIterator(u8, .scalar),
pubfninitPath(path: []constu8) @This() {
return .{ .paths=std.mem.tokenizeScalar(u8, path, ':') };
}
pubfninitEnv(env: []constu8) @This() {
returninitPath(std.os.getenv(env) orelse"");
}
pubfnnext(self: *@This()) ?[]constu8 {
returnself.paths.next();
}
};(Could have nextWithComponent, to construct the relevant path for you too)
I'm not sure about zig std's status quo, but I wouldn't rely on |
JerwuQu
commented
Feb 6, 2024
I can't say about adding utility methods. Seems a bit redundant when the code to iterate PATH is already so simple. About |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0391659 to
497211dCompare497211d to
35e0deaCompareJerwuQu
commented
Feb 19, 2024
Sorry for the delay! Have been busy and had no access to my desktop for a bit. I followed the suggestion to use Maybe there are some new issues due to the implemenation changing slightly, don't be afraid to nitpick. |
35e0dea to
7f635eeCompareandrewrk
commented
May 9, 2024
I'm sorry, I didn't review this in time, and now it has bitrotted. Furthermore, so many pull requests have stacked up that I can't keep up and I am therefore declaring Pull Request Bankruptcy and closing old PRs that now have conflicts with master branch. If you want to reroll, you are by all means welcome to revisit this changeset with respect to the current state of master branch, and there's a decent chance your patch will be reviewed the second time around. Either way, I'm closing this now, otherwise the PR queue will continue to grow indefinitely. |
JerwuQu
commented
May 9, 2024
Understandable! Unfortunate though that it's the second time for the same issue. Haven't been using Termux recently but might create a new PR if I do. |
andrewrk
commented
May 10, 2024
It is indeed unfortunate, however I think in this case it is because someone else made a related change, so your change might not be necessary anymore and needs to be re-evaluated, or at least reintegrated. Anyway my point is that progress has been made. |
Another go at #14146, following @andrewrk's latest comment.
Am still pretty fresh at Zig stdlib code so feedback appreciated (e.g. is
FixedBufferAllocatorthe best way here?)