Skip to content

fix: stop -w and -o changing bytes they did not fix - #20

Merged
catinspace-au merged 1 commit into
mainfrom
fix/macbash-bytes
Oct 28, 2026
Merged

catinspace-au merged 1 commit into
mainfrom
fix/macbash-bytes

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Three small fixes in the fix path and text output.

  • -w keeps CRLF, a missing final newline and an empty file exactly as they were unless a line is actually fixed.
  • -o keeps the input's permission bits, and one unreadable file no longer hides the other files' results (it is reported on stderr and the run exits 1).
  • Text output shows 2:1: instead of 2:2:1:.

Done when -w on CRLF, no-trailing-newline and empty input reports 0 fixes and changes no bytes.

Closes #7
Closes #8
Closes #9

-w rebuilt the file from its lines, turning CRLF into LF, adding a final
newline and turning an empty file into one newline while reporting 0
fixes. Each line now keeps its own terminator.

-o now copies the input's permission bits, so a fixed script stays
executable. A file that cannot be read is reported on stderr and the
other files are still scanned, exiting 1. The run only aborts when
nothing could be read.

Text output printed the line number twice (2:2:1). It is now 2:1.
@catinspace-au
catinspace-au merged commit 73c8aad into main Oct 28, 2026
18 checks passed
@catinspace-au
catinspace-au deleted the fix/macbash-bytes branch October 28, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant