Skip to content

Fix: stack overflow in FindFileInParentDirs on Windows#113

Merged
alajmo merged 3 commits intoalajmo:mainfrom
aabiskar1:fix-infinite-recursion-find-file-windows
Dec 5, 2025
Merged

Fix: stack overflow in FindFileInParentDirs on Windows#113
alajmo merged 3 commits intoalajmo:mainfrom
aabiskar1:fix-infinite-recursion-find-file-windows

Conversation

@aabiskar1
Copy link
Contributor

@aabiskar1 aabiskar1 commented Dec 5, 2025

Fixes #112

filepath-Dir() returns the same path when already at the filesystem root (eg, C:), causing infinite recursion.

What's Changed

Added check to detect when parentDir equals path, which terminates the recursion properly.

Technical Description

Root Cause
filepath.Dir() returns the same path when already at filesystem root
(e.g., C:\), causing infinite recursion.

Solution
Added check if parentDir == path before recursing.

filepath-Dir() returns the same path when already at the filesystem root (eg, C:\), causing infinite recursion. Added check to detect when parentDir equals path, which terminates the recursion properly.
@aabiskar1 aabiskar1 requested a review from alajmo December 5, 2025 13:05
Copy link
Owner

@alajmo alajmo left a comment

Choose a reason for hiding this comment

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

Thanks for catching this bug and fixing it!

@alajmo alajmo merged commit 1402067 into alajmo:main Dec 5, 2025
1 check passed
@alajmo
Copy link
Owner

alajmo commented Dec 5, 2025

This is now released as of 0.31.2.

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.

Stack overflow error when running mani commands on Windows

2 participants