From d05d908ac86243ca9413fbcad38e3d09a66c4b8a Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 4 Jan 2025 18:41:27 +1100 Subject: next_line in qstd --- qstd/str.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qstd/str.c') diff --git a/qstd/str.c b/qstd/str.c index 5461880..710409b 100644 --- a/qstd/str.c +++ b/qstd/str.c @@ -64,3 +64,11 @@ char* dup_stringh(struct Heap* h, const char* s) { string_copy(d, s); return d; } + +const char* next_line(const char* line) { + const char* c; + for (c = line; *c != '\n'; c++) { + if (!*c) return 0; + } + return c + 1; +} -- cgit v1.2.3-54-g00ecf