9 Limitations ¶
If the terminal hangs up and the buffer is modified and not empty,
ed attempts to write the buffer to the file ed.hup or, if
this fails, to $HOME/ed.hup.
If a text (non-binary) file is not terminated by a newline character, then
ed appends one on reading/writing it. In the case of a binary
file, ed does not append a newline on reading/writing. A binary
file is one containing at least one ASCII NUL character. If the last line
has been modified, reading an empty file, for example /dev/null,
prior to writing prevents appending a newline to a binary file.
In order to keep track of the text lines in the buffer, ed uses a
doubly linked list of structures containing the position and size of each
line. This results in a per line overhead of 2 ‘pointer’s,
1 ‘long int’, and 1 ‘int’. The maximum line length is
INT_MAX - 1 bytes. The maximum number of lines is INT_MAX - 2 lines.