diff options
Diffstat (limited to 'src/libstddjb/skagetln_loose.c')
-rw-r--r-- | src/libstddjb/skagetln_loose.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstddjb/skagetln_loose.c b/src/libstddjb/skagetln_loose.c new file mode 100644 index 0000000..7fc5916 --- /dev/null +++ b/src/libstddjb/skagetln_loose.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include <errno.h> +#include <skalibs/stralloc.h> +#include <skalibs/skamisc.h> + +int skagetln_loose (buffer *b, stralloc *sa, char sep) +{ + int e = errno ; + int r = skagetln(b, sa, sep) ; + if (r >= 0) return r ; + if (errno != EPIPE) return -1 ; + if (!stralloc_0(sa)) return -1 ; + return (errno = e, 3) ; +} |