Repository navigation
Fix native file I/O bugs and add regression coverage - #86
Merged
tlindner merged 1 commit intoOct 28, 2026
Merged
Conversation
- libnative/libnativereadln.c:46: include the converted newline in the returned byte count, including empty lines and full buffers. - libnative/libnativeopen.c:187: open write-only files with O_WRONLY and fdopen without truncating, appending, creating missing files, or requiring read permission; preserve binary mode on Windows and close descriptors on fdopen failure. - libnative/libnativeseek.c:21: propagate fseek failures through UnixToCoCoError instead of reporting success. - libnative/libnativerename.c:21: allocate a terminated destination path, preserve the directory prefix, and return rename errors before freeing the buffer. - unittest/libnativetest.c:46,71,125,156,180,202: add ten TinyTest cases covering line counts, EOF, write-only opens, failed seeks, missing rename sources, and in-directory renames. - build/unix/unittest/Makefile:24,34: build and run libnativetest in the standard suite; .gitignore:23: ignore its generated executable. Confirmed each primary regression failed before its fix. Validation: make -C build/unix passes all 42 tests; git diff --check passes.
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.
Confirmed each primary regression failed before its fix. Validation: make -C build/unix passes all 42 tests; git diff --check passes.