From 24c90b7700e18d0668799f8f343bc854a42dea20 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 10 Oct 2018 11:28:46 +0200 Subject: Configuration parser cleanup - Do a getline() & process in rdline instead of doing a read per character and feeding it through a state machine. - Move splitkv to rdcfg.c, the only place where it is used Signed-off-by: David Oberhollenzer --- cmd/runsvc/env.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/runsvc/env.c b/cmd/runsvc/env.c index 4fe2368..1e73ee4 100644 --- a/cmd/runsvc/env.c +++ b/cmd/runsvc/env.c @@ -41,7 +41,7 @@ static struct entry *parse_list(rdline_t *rd) char *ptr; while (rdline(rd) == 0) { - ptr = rd->buffer; + ptr = rd->line; while (*ptr != '\0' && *ptr != ' ' && *ptr != '=') ++ptr; @@ -66,11 +66,11 @@ static struct entry *parse_list(rdline_t *rd) continue; } - e = calloc(1, sizeof(*e) + strlen(rd->buffer) + 1); + e = calloc(1, sizeof(*e) + strlen(rd->line) + 1); if (e == NULL) goto fail_oom; - strcpy(e->data, rd->buffer); + strcpy(e->data, rd->line); e->next = list; list = e; } -- cgit v1.2.3