Skip to content

strip any extension from imported dll names - #23

Merged
evmar merged 1 commit into
evmar:mainfrom
LinusU:lu-dll-extension
Sep 16, 2026
Merged

evmar merged 1 commit into
evmar:mainfrom
LinusU:lu-dll-extension

Conversation

@LinusU

@LinusU LinusU commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

If you rather I add another check specifically for .drv instead I'd be happy to do that instead!

From Claude Fable 5.1 (high):

The imported module name doubles as a Rust module path, and only .dll was being trimmed. WINSPOOL.DRV produced a path with a dot in it. Drop whatever extension is present instead.

WINSPOOL.DRV imports produced a module path with a dot in it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@evmar

evmar commented Sep 16, 2026

Copy link
Copy Markdown
Owner

According to an LLM (heh), it seems like the Windows behavior is to strip the extension in any case, because there are other file types that have similar behavior, like .ocr for screensaver modules.

@evmar
evmar merged commit c558d29 into evmar:main Sep 16, 2026
2 checks passed
Comment thread tc/src/exe.rs
// (.dll, or .drv for winspool).
let name = name
.rsplit_once('.')
.map_or(name.as_str(), |(stem, _)| stem);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if .with_extension("") would be better, not that I really care
https://doc.rust-lang.org/std/path/struct.Path.html#method.with_extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants