From 08676a97cda1f52c2bbdb9b79c36cc32089fda73 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 5 Dec 2020 23:34:09 +0100 Subject: [PATCH] Make dotconf_create fname const char * Since it does not modify it, and callers might be using a const string. --- src/dotconf.c | 4 ++-- src/dotconf.h | 2 +- src/dotconf_priv.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dotconf.c b/src/dotconf.c index 7ba2001..968f9e5 100644 --- a/src/dotconf.c +++ b/src/dotconf.c @@ -768,7 +768,7 @@ void dotconf_cleanup(configfile_t * configfile) free(configfile); } -configfile_t *dotconf_create(char *fname, const configoption_t * options, +configfile_t *dotconf_create(const char *fname, const configoption_t * options, context_t * context, unsigned long flags) { char *dc_env = NULL; @@ -1423,7 +1423,7 @@ char *get_cwd(void) return buf; } -char *get_path(char *name) +char *get_path(const char *name) { char *tmp; char *buf = NULL; diff --git a/src/dotconf.h b/src/dotconf.h index 86b7c4c..1cd8fc4 100644 --- a/src/dotconf.h +++ b/src/dotconf.h @@ -176,7 +176,7 @@ extern "C" { }; /* ------ dotconf_create() - create the configfile_t needed for further dot.conf fun ------------ */ - configfile_t *dotconf_create(char *, const configoption_t *, + configfile_t *dotconf_create(const char *, const configoption_t *, context_t *, unsigned long); /* ------ dotconf_cleanup() - tidy up behind dotconf_create and the parser dust ----------------- */ diff --git a/src/dotconf_priv.h b/src/dotconf_priv.h index 8b208d4..61a5139 100644 --- a/src/dotconf_priv.h +++ b/src/dotconf_priv.h @@ -37,6 +37,6 @@ char *get_cwd(void); -char *get_path(char *name); +char *get_path(const char *name); #endif