From 9b850a9788abf1974159c81968d8ff3e27dc3b17 Mon Sep 17 00:00:00 2001 From: WhitePeter Date: Thu, 28 Oct 2021 05:45:14 +0200 Subject: [PATCH] ini.c: Removed include code. Also reverted stripping of section names. --- src/ini.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/ini.c b/src/ini.c index ca9005da9..3db157ed6 100644 --- a/src/ini.c +++ b/src/ini.c @@ -93,32 +93,6 @@ struct ini *load_ini_file(FILE *fp) while (getline(&line, &line_len, fp) != -1) { line_num++; - /** Crude file inclusion support. - * - * TODO: Beware of include loops! Should we care more than - * warning about it in the manual? */ - if (0 == strncmp("@INCLUDE", line, 8) && strchr(line, '=')) { - gchar **split_line = g_strsplit(line, "=", 2); - gchar *inc_path; - /* Double check since previous one would allow "@INCLUDEFOO" */ - if (0 == strcmp("@INCLUDE", g_strstrip(split_line[0])) - && (inc_path = g_strstrip(split_line[1]))) { - LOG_D("Trying to include '%s'", inc_path); - FILE *f; - - if ((f = fopen_conf(inc_path))) { - load_ini_file(f); - LOG_D("Closing included file, fd: '%d'", fileno(f)); - fclose(f); - } else - g_free(inc_path); - } else - LOG_W("Invalid '@INCLUDE' line '%d'", line_num); - - g_strfreev(split_line); - continue; - } - char *start = g_strstrip(line); if (*start == ';' || *start == '#' || STR_EMPTY(start))