Support NUL-containing lines in sort(1)

For sort(1) we need memmem(), which I imported from OpenBSD.
Inside sort(1), the changes involved working with the explicit lengths
given by getlines() earlier and rewriting some of the functions.

Now we can handle NUL-characters in the input just fine.
This commit is contained in:
FRIGN
2016-02-29 00:47:10 +01:00
committed by sin
parent e4810f1cdb
commit eb9bda8787
5 changed files with 176 additions and 84 deletions

2
util.h
View File

@@ -76,3 +76,5 @@ long long enstrtonum(int, const char *, long long, long long);
long long estrtonum(const char *, long long, long long);
size_t unescape(char *);
int mkdirp(const char *);
#undef memmem
void *memmem(const void *, size_t, const void *, size_t);