Repository navigation
Look up a configured program named alone without the program's folder - #36
Merged
Merged
Conversation
A command's `program` given as a bare name went to std's search, which looks in the running executable's own folder before the system folder and PATH (`Command::new`). With the FanControl recipe, a copy unpacked in Downloads would have run a schtasks.exe lying beside it at every game start and stop. actions::locate now resolves a bare name itself, in std's order without that folder: the command's own PATH, the system folder, the Windows folder (win::windows_dir, beside system_dir), the process's PATH, absolute entries only, .exe added to a name with no dot. A program given with a folder starts as written. The log names the file started. Measured with `trigger start` and a stand-in schtasks.exe beside each copy: build 909f77b7 ran the stand-in, this one System32's. The recipes keep their bare names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #35 (
dll-search): GitHub retargets this PR tomainonce #35 is merged and its branch deleted.What
A command's
programgiven as a name alone (schtasks.exein the FanControl recipe,powercfg.exe,powershell.exe) went to std's search, which looks in the running executable's own folder before the system folder andPATH(Command::new). A copy unpacked in Downloads would have run aschtasks.exelying beside it at every game start and stop.actions::locatenow resolves a bare name itself, in std's order without that folder:PATHthe command's ownenvsets, if any;win::system_dir);win::windows_dir, new,GetWindowsDirectoryW);PATH.Only absolute
PATHentries count, the current folder never does, and.exeis added to a name with no dot (std's rule). A program given with a folder starts as written. The log's Starting a command line gainspath, the file started.The recipes keep their bare names: with this change they are safe, and a hard-coded
C:\Windows\System32\...would not be portable.Measured
trigger startwith a scratch configuration (program = "schtasks.exe") and a stand-inschtasks.exebeside each copy, in a scratch folder:909f77b7(#35, installed here)C:\WINDOWS\system32\schtasks.exebuild.ps1 testandbuildOK; 8 unit tests for the rule (system folder beforePATH, the copy's own folder and relative entries never,.exeonly without an extension, the command'sPATHfirst, quotedPATHentries, a path-like program untouched, empty and not found are errors).Not verified yet
path=C:\WINDOWS\system32\schtasks.exefor the maintainer's commands.Docs
Reference (
programrow), Getting started, How it works,config.example.toml, CHANGELOG Fixed, a dated note indocs/design/08-distribution.md, and AGENTS.md's pitfall line.🤖 Generated with Claude Code