GNU nano - Bugs: bug #63106, piping text to an external command...
You are not allowed to post comments on this tracker with your current authentication level.
bug #63106: piping text to an external command fails to decode NUL bytes
Submitter: | Benno Schulenberg <bens> | ||
Submitted: | Mon 26 Sep 2022 09:01:42 AM UTC | ||
Severity: | 2 - Minor | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Tue 27 Sep 2022 01:51:07 PM UTC, comment #1: |
Benno Schulenberg <bens> |
Mon 26 Sep 2022 09:01:42 AM UTC, original submission:
When reading text from a file (or from standard input), nano recodes any NUL byte to a linefeed (\n); and when writing out a buffer to a file, nano recodes any embedded linefeed back to a NUL byte. But when piping text to an external command, this recoding of embedded linefeed to NUL is lacking, resulting in an unintended line break in the text that the external command sees.
See that nano shows "one^@two", where ^@ is the NUL byte.
Now nano shows "ane^@two", which proves that 'sed' sees the text as a single line, as otherwise it would have substituted the second o too.
|
Benno Schulenberg <bens> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 5 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2022-11-16 | bens | Open/Closed | Open | Closed | |
2022-09-27 | bens | Status | In Progress | Fixed | |
Summary | piping text to a command fails to decode NUL bytes | piping text to an external command fails to decode NUL bytes | |||
2022-09-27 | bens | Status | None | In Progress | |
Assigned to | None | bens |
Powered by Savane 3.13-4448.
Corresponding source code
Fixed in git, commit 1dc2a75c, by running recode_LF_to_NUL() on each line's data before writing it out to the pipe.