4 ms·
Using NUL as the terminator would have been incredibly incompatible with Unix's choice of systems programming language. PC-DOS did not invent CRLF as the line
by chuckadams 1y ago
Using NUL as the terminator would have been incredibly incompatible with Unix's choice of systems programming language. PC-DOS did not invent CRLF as the line terminator, it was already in common use in CP/M and VMS at the time.
- jibal 1y agoNo, it would have been completely compatible with C ... that's the point.
- chuckadams 1y agoCompletely compatible, other than making most programs incapable of expressing multiple lines in one string that is. Or a partial line in a single string, since "end of line" and "end of string" would be indistinguishable.
- jibal 1y agoThis is conceptually confused. There are numerous ways to represent multiple lines in applications that want to operate on them, including separating them with LF, or any other code sequence ... but a better choice is using an array of pointers. As for partial lines, this is a matter of how one is semantically interpreting a string ... numerous C programs operate on lines with the LF stripped, and operate on all sorts of other strings, including substrings of lines. Anyway, it's moot since UNIX didn't take this approach. I won't respond further.