Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text mode is ignored on Windows. #9

Closed
damaki opened this issue Feb 7, 2020 · 0 comments · Fixed by #10
Closed

Text mode is ignored on Windows. #9

damaki opened this issue Feb 7, 2020 · 0 comments · Fixed by #10
Assignees
Labels

Comments

@damaki
Copy link
Owner

damaki commented Feb 7, 2020

When ksum is run on Windows the expected behaviour of --text mode is that CRLF newlines are converted to LF newlines when reading input data. However, file data is always read in binary mode and CRLF are not converted, i.e. --text mode has the same behaviour as --binary on all systems.

After some investigation, this seems to be caused by using Ada.Text_IO.Text_Streams to read from the input files. Even when the file is opened with Form="text_translation=yes", stream reading always sets the file to binary mode before performing the read. See Ada RM A.12.2/6 which mentions mixing text/binary modes for text streams.

@damaki damaki self-assigned this Feb 7, 2020
@damaki damaki added the bug label Feb 7, 2020
@damaki damaki mentioned this issue Feb 7, 2020
@damaki damaki closed this as completed in #10 Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant