paste: Support -d '\0'
POSIX specifies that -d '\0' sets the delimiter to an empty string.
This commit is contained in:
committed by
Michael Forney
parent
28063c02f4
commit
2f0b15201d
13
libutf/utf.c
13
libutf/utf.c
@@ -62,6 +62,19 @@ utfnlen(const char *s, size_t len)
|
||||
return i;
|
||||
}
|
||||
|
||||
size_t
|
||||
utfmemlen(const char *s, size_t len)
|
||||
{
|
||||
const char *p = s;
|
||||
size_t i;
|
||||
Rune r;
|
||||
int n;
|
||||
|
||||
for(i = 0; (n = charntorune(&r, p, len-(p-s))); i++)
|
||||
p += n;
|
||||
return i;
|
||||
}
|
||||
|
||||
char *
|
||||
utfrune(const char *s, Rune r)
|
||||
{
|
||||
|
Reference in New Issue
Block a user