Repository navigation
Fix three decb copy bugs and add regression coverage - #88
Merged
Merged
Conversation
Fix native directory destinations (decb/decbcopy.c:225). The directory-target branch previously populated the destination path only for image paths containing a comma, leaving host-directory targets empty. Join the host directory and source basename, handle an optional trailing slash, and reject paths that exceed the destination buffer. Regression: unittest/decbcommandtest.c:99 checks both directory forms and verifies the extracted binary file's exact size and contents. Prevent silent empty copies with -l (decb/decbcopy.c:462). EOL translation handled native-to-CoCo and CoCo-to-native copies but skipped all writes for same-format endpoints while still reporting success. Only enter the translation path when crossing the native/CoCo boundary; otherwise perform a normal byte-for-byte write. Regression: unittest/decbcommandtest.c:146 covers disk-to-disk and native-to-native copies, preserving CR, LF, and CRLF bytes. Preserve empty-file metadata (decb/decbcopy.c:522, :534). Metadata copying and explicit file/data type overrides were inside the nonempty-data block, so empty files ignored options such as -3a and lost source metadata during disk-to-disk copies. Apply metadata independently of whether there are any data bytes to write. Regression: unittest/decbcommandtest.c:200 verifies text-editor/ASCII metadata for an empty import and its subsequent disk-to-disk copy. Register all three regressions at unittest/decbcommandtest.c:246-248. Validation: - Each new regression failed before its corresponding fix. - make -C build/unix succeeded; all 57 tests passed. - git diff --check passed. Line references above refer to the resulting files in this commit.
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.
Fix native directory destinations (decb/decbcopy.c:225). The directory-target branch previously populated the destination path only for image paths containing a comma, leaving host-directory targets empty. Join the host directory and source basename, handle an optional trailing slash, and reject paths that exceed the destination buffer. Regression: unittest/decbcommandtest.c:99 checks both directory forms and verifies the extracted binary file's exact size and contents.
Prevent silent empty copies with -l (decb/decbcopy.c:462). EOL translation handled native-to-CoCo and CoCo-to-native copies but skipped all writes for same-format endpoints while still reporting success. Only enter the translation path when crossing the native/CoCo boundary; otherwise perform a normal byte-for-byte write.
Regression: unittest/decbcommandtest.c:146 covers disk-to-disk and native-to-native copies, preserving CR, LF, and CRLF bytes.
Preserve empty-file metadata (decb/decbcopy.c:522, :534). Metadata copying and explicit file/data type overrides were inside the nonempty-data block, so empty files ignored options such as -3a and lost source metadata during disk-to-disk copies. Apply metadata independently of whether there are any data bytes to write.
Regression: unittest/decbcommandtest.c:200 verifies text-editor/ASCII metadata for an empty import and its subsequent disk-to-disk copy. Register all three regressions at unittest/decbcommandtest.c:246-248.
Validation:
Line references above refer to the resulting files in this commit.