Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Jan 2024 19:05:54 +0100
From:      Steffen Nurpmeso <steffen@sdaoden.eu>
To:        Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: c2356a440db9 - main - asa: Rewrite to fix line termination issue.
Message-ID:  <20240109180554.UYZwm9Yl@steffen%sdaoden.eu>
In-Reply-To: <202401091627.409GRcI0028831@gitrepo.freebsd.org>
References:  <202401091627.409GRcI0028831@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Sm=C3=B8rgrav wrote in
 <202401091627.409GRcI0028831@gitrepo.freebsd.org>:
 |The branch main has been updated by des:
 |
 |URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc2356a440db91c106867d45c94=
b\
 |3d6d7bc0e50f0
 |
 |commit c2356a440db91c106867d45c94b3d6d7bc0e50f0
 |Author:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
 |AuthorDate: 2024-01-09 14:09:41 +0000
 |Commit:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
 |CommitDate: 2024-01-09 16:27:15 +0000
 |
 |    asa: Rewrite to fix line termination issue.
 |   =20
 |    The standard is somewhat unclear, but on the balance, I believe \
 ...
 |    - Second, it unconditionally emits a newline at the end of the output
 |      for non-empty input, even if the input did not end with a newline.
  ...

I want to point out that POSIX only knows about text files which
end with a LF newline.  Otherwise it is not a text file.  (I think
Stallman and emacs joke on this by allowing something else, iirc
from before Y2K when i shortly used it, and, funnily, from some
thread on another ML just last week or so, where it was claimed
that this could have roots in emacse not rooting in UNIX.)

That is (sorry for that) "3.387 Text File" is a "file that
contains characters organized into zero or more lines. The lines
do not contain NUL characters and none can exceed {LINE_MAX} bytes
in length, including the <newline> character".
And "3.185 Line" is a "sequence of zero or more non-<newline>
characters plus a terminating <newline> character".
Crystal clear thus (:)).

P.S.: numbers are from Draft 4 of upcoming POSIX standard.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20240109180554.UYZwm9Yl>