Skip to content

Fix an issue with ensure_dir#127

Merged
mworrell merged 2 commits into
masterfrom
fix-ensure-dir-edge-case
Jul 14, 2026
Merged

Fix an issue with ensure_dir#127
mworrell merged 2 commits into
masterfrom
fix-ensure-dir-edge-case

Conversation

@mworrell

Copy link
Copy Markdown
Member

This pull request makes a small change to the first_missing/2 function in src/z_filelib.erl to alter its return value. Instead of returning just the reversed accumulator list when the input list is empty, it now returns a tuple containing the reversed accumulator and an empty list.

  • src/z_filelib.erl: Modified the base case of first_missing/2 to return {lists:reverse(Acc), []} instead of lists:reverse(Acc).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts z_filelib:ensure_dir/1’s internal helper first_missing/2 by changing its empty-input base case to return a tuple instead of a bare list, aiming to make the helper’s return shape consistent for callers handling symlink edge cases.

Changes:

  • Updated first_missing/2 base case to return a 2-tuple when the input list is empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/z_filelib.erl Outdated
@mworrell
mworrell merged commit 4d2a5d4 into master Jul 14, 2026
3 checks passed
@mworrell
mworrell deleted the fix-ensure-dir-edge-case branch July 14, 2026 11:15
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