diff options
-rw-r--r-- | qstd/str.c | 8 | ||||
-rw-r--r-- | qstd/str.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -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; +} @@ -16,5 +16,6 @@ int string_copy(char* dst, const char* src); int string_len(const char* s); char* dup_string(struct Arena* a, const char* s); char* dup_stringh(struct Heap* h, const char* s); +const char* next_line(const char* line); #endif |