summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-04 21:11:27 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-04 21:11:27 -0400
commitc32f7dd056a97fc322d1328c9c44d2e05d8bd7c6 (patch)
tree7e7698cd0ac796c05e585c2213b33d742489d330 /config.c
parentfb609a2d7857049ba1eda73d055add640c8ff91f (diff)
Added `find_line()`.
Which finds the next line in the buffer.
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.c b/config.c
index d1bdb10..a343448 100644
--- a/config.c
+++ b/config.c
@@ -56,6 +56,11 @@ char *read_file(const char *filename, long *size) {
return buf;
}
+char *find_line(char *str) {
+ for (; *str != '\n' && *str != '\0'; str++);
+ return str;
+}
+
config *parse_config(const char *filename) {
/* Size of the file, in bytes. */
long filesize = 0;