Hi,
As this is a topic more about sbase/ubase organization more
than about patches I am going to move the discussion to the
dev mailing list. Please, answer there instead of here in
hackers.
Regards,
Hi,
I was thinking about what to do with these patches adding new
commands. They raised a concern about what should be the scope of
sbase. The idea of sbase was to provide a minimal portable POSIX
base, while having ubase for the POSIX commands that cannot be
implemented in a portable way.
On Sun, Mar 03, 2024 at 12:34:16AM +0100, Elie Le Vaillant wrote:
> +static void
> +tac(FILE *fp)
> +{
> + struct linebuf buf = EMPTY_LINEBUF;
> + struct line line;
> + getlines(fp, );
> +
> + if (buf.nolf) {
> + /* If the last line is not LF-terminated, the
> +
Eric Pruitt wrote:
> I think there should be separate implementations for seekable vs
> non-seekable files to avoid buffering the entire contents of
> the file in memory unnecessarily.
In fact, performance could be also improved for non-seekable files
by forcing a seekable context, ie. use a
---
.gitignore | 1 +
Makefile | 1 +
README | 1 +
libutil/getlines.c | 3 +-
tac.1 | 22 +++
tac.c | 68 ++
text.h | 3 +-
7 files changed, 97 insertions(+), 2
---
.gitignore | 1 +
Makefile | 1 +
README | 1 +
libutil/getlines.c | 3 +-
tac.1 | 22 +++
tac.c | 68 ++
text.h | 3 +-
7 files changed, 97 insertions(+), 2