Skip to content

Disable wordexp on Windows where it is unavailable#155

Merged
giulianobelinassi merged 1 commit intoSUSE:mainfrom
KenoAIStaging:disable-wordexp-on-windows
Oct 9, 2025
Merged

Disable wordexp on Windows where it is unavailable#155
giulianobelinassi merged 1 commit intoSUSE:mainfrom
KenoAIStaging:disable-wordexp-on-windows

Conversation

@Keno
Copy link
Contributor

@Keno Keno commented Oct 8, 2025

Mingw does not provide wordexp (and neither does MSVC for that matter). In general though, windows programs (outside of specific exceptions like bash) are not expected to perform shell expansion, so just disable this feature under windows.

AI disclaimer: Written by Claude Code.

The wordexp() function is a POSIX extension not available on Windows.
This patch conditionally compiles wordexp usage only on non-Windows platforms.

On Windows, the path is used as-is without shell expansion, since Windows
does not support tilde expansion in the same way as POSIX systems.

Changes:
- Wrap #include <wordexp.h> with #ifndef _WIN32
- Add platform-specific constructor implementations
- Windows version simply stores the path without expansion
@giulianobelinassi
Copy link
Collaborator

Looks fine to me.

@giulianobelinassi giulianobelinassi merged commit 5da3619 into SUSE:main Oct 9, 2025
8 checks passed
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