[vlc-commits] intf-add: do not list CLI if stdin is not a TTY (fix #4955)

Rémi Denis-Courmont git at videolan.org
Mon Jun 20 19:10:11 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jun 20 20:07:48 2011 +0300| [8ac466488795c555fb32978509eb62df40ad57f0] | committer: Rémi Denis-Courmont

intf-add: do not list CLI if stdin is not a TTY (fix #4955)

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

 src/interface/interface.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/interface/interface.c b/src/interface/interface.c
index 6b400da..800a20c 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -85,10 +85,12 @@ int intf_Create( vlc_object_t *p_this, const char *psz_module )
                 VLC_VAR_HASCHOICE | VLC_VAR_ISCOMMAND );
     text.psz_string = _("Add Interface");
     var_Change( p_intf, "intf-add", VLC_VAR_SETTEXT, &text, NULL );
-
-    val.psz_string = (char *)"rc";
-    text.psz_string = (char *)_("Console");
-    var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text );
+    if( isatty( 0 ) )
+    {
+        val.psz_string = (char *)"rc";
+        text.psz_string = (char *)_("Console");
+        var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text );
+    }
     val.psz_string = (char *)"telnet";
     text.psz_string = (char *)_("Telnet");
     var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text );



More information about the vlc-commits mailing list