[vlc-commits] Consider an empty boolean option as true

Ludovic Fauvet git at videolan.org
Wed Jan 2 17:33:42 CET 2013


npapi-vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Jan  2 17:16:00 2013 +0100| [d503f31619561ff14e000268211a3d5d2d86757c] | committer: Ludovic Fauvet

Consider an empty boolean option as true

This ensures compatibility with the following example:
    <video width="320" height="240" controls>

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

 npapi/vlcplugin_base.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index 9fd1567..ba0b872 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -59,7 +59,8 @@ VlcPluginBase::VlcPluginBase( NPP instance, NPuint16_t mode ) :
 }
 
 static bool boolValue(const char *value) {
-    return ( !strcmp(value, "1") ||
+    return ( *value == NULL ||
+             !strcmp(value, "1") ||
              !strcasecmp(value, "true") ||
              !strcasecmp(value, "yes") );
 }



More information about the vlc-commits mailing list