From b2961ea4a792fa7e5bead6e49d399dcea55b039b Mon Sep 17 00:00:00 2001
From: David Härdeman <david@hardeman.nu>
Date: Tue, 30 Jun 2020 10:03:07 +0200
Subject: Keep track of current line number in config file parsing

---
 minecproxy/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'minecproxy')

diff --git a/minecproxy/main.c b/minecproxy/main.c
index b5a195b..92961e2 100644
--- a/minecproxy/main.c
+++ b/minecproxy/main.c
@@ -255,6 +255,7 @@ static void cfg_read()
 	char *pos = buf;
 	size_t rd = 0;
 	size_t r;
+	unsigned lineno;
 
 	assert_return(cfg);
 
@@ -294,7 +295,7 @@ static void cfg_read()
 	*pos = '\0';
 	pos = buf;
 
-	if (!config_parse_header("mcproxy", &pos))
+	if (!config_parse_header("mcproxy", &pos, &lineno))
 		die("main config file (%s) missing/invalid header", path);
 
 	while (true) {
@@ -303,7 +304,7 @@ static void cfg_read()
 		struct cfg_value value;
 
 		if (!config_parse_line(path, &pos, mcfg_key_map, &key, &keyname,
-				       &value, false))
+				       &value, false, &lineno))
 			break;
 
 		if (key == MCFG_KEY_INVALID)
-- 
cgit v1.2.3