[vlc-commits] config: display unknown options

Alexandre Janniaux git at videolan.org
Mon Oct 5 20:45:18 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Sep 21 12:53:09 2020 +0200| [a7d548dbdedc9669550a02121fa352f311e2cd19] | committer: Alexandre Janniaux

config: display unknown options

When an unknown option is requested, the assertion triggers on the null
configuration variable, but the name of the missing variable is not
displayed.

While it's (sometimes) possible to display it through debugger or
additional code, the assertion is very usual and the message is
especially useful when debugging mobile devices or using libvlc without
being a core developer.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a7d548dbdedc9669550a02121fa352f311e2cd19
---

 src/config/core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/config/core.c b/src/config/core.c
index b24ef59ab4..d2cdb3c468 100644
--- a/src/config/core.c
+++ b/src/config/core.c
@@ -116,6 +116,11 @@ char *config_GetPsz(const char *psz_name)
 
     p_config = config_FindConfig( psz_name );
 
+#ifndef NDEBUG
+    if (p_config == NULL)
+        fprintf(stderr, "Unknown vlc configuration variable named %s\n", psz_name);
+#endif
+
     /* sanity checks */
     assert(p_config != NULL);
     assert(IsConfigStringType (p_config->i_type));



More information about the vlc-commits mailing list