[hackers] Penfing patches for sbase and ubase

2024-02-26 Thread Roberto E. Vargas Caballero
Hi, I know that there are some pending patches for sbase and ubase, but I am a bit busy these days and I will not be able to look a bit deeper on them until next week. Be patient until then :) Thank you

[hackers] [sbase][PATCH] sort: remove useless allocation

2024-02-26 Thread Elie Le Vaillant
I'm not sure why we're doing malloc() then memcpy() here, when we could just make col->line.data point to start.data. This is costy for huge sorts (3 time slower than other implementations with no real reason). Since we are now working with the original line.data we need to revert the s/\n/\0/

[hackers] [sbase][PATCH] Add implementation of shuf(1)

2024-02-26 Thread Elie Le Vaillant
--- .gitignore | 1 + Makefile | 1 + README | 1 + shuf.1 | 43 + shuf.c | 110 + 5 files changed, 156 insertions(+) create mode 100644 shuf.1 create mode 100644 shuf.c diff --git a/.gitignore

[hackers] [sbase][PATCH] Add implementation of ts(1)

2024-02-26 Thread Elie Le Vaillant
The -m flag is not compliant to either the OpenBSD or the moreutils implementation of ts(1), but closer to the toybox one. It allows the user to add in nanoseconds, like toybox, but allows to specify how many digits are printed. --- .gitignore | 1 + Makefile | 1 + README | 1 + ts.1

[hackers] [sbase][PATCH] Add strptime, which replaces date-parsing in date(1)

2024-02-26 Thread Elie Le Vaillant
usage: strptime fmt timestamp Most other userspace implementations allow in date(1) the parsing of dates. That way, one can use a date string, and manipulate it in scripts. However, the current date(1) implementation only accepts Unix epochs to describe date and time. Rather than patching

[hackers] [sbase][PATCH] Add implementation of tac(1)

2024-02-26 Thread Elie Le Vaillant
--- .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