[vlc-commits] config/file: reject saved unsaveables
Lyndon Brown
git at videolan.org
Thu Feb 22 18:11:10 CET 2018
vlc | branch: master | Lyndon Brown <jnqnfe at gmail.com> | Tue Feb 20 04:46:18 2018 +0000| [018987d0f9d3779f6ee91d45e01c74acc86b836e] | committer: Rémi Denis-Courmont
config/file: reject saved unsaveables
Options which are unsaveable can nevertheless end up being present in the
saved settings file either from a past release where they were not
considered unsaveable, or through external modification of the file. Values
for such options should simply be rejected when reading the file.
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=018987d0f9d3779f6ee91d45e01c74acc86b836e
---
src/config/file.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/config/file.c b/src/config/file.c
index 6270a6bc9d..2730d0bf80 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -137,7 +137,6 @@ static FILE *config_OpenConfigFile( vlc_object_t *p_obj )
return p_stream;
}
-
static int64_t vlc_strtoi (const char *str)
{
char *end;
@@ -208,6 +207,10 @@ int config_LoadConfigFile( vlc_object_t *p_this )
if (item == NULL)
continue;
+ /* Reject values of options that are unsaveable */
+ if (item->b_unsaveable)
+ continue;
+
const char *psz_option_value = ptr + 1;
switch (CONFIG_CLASS(item->i_type))
{
More information about the vlc-commits
mailing list