[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:11:26 CEST 2011
vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jun 20 20:07:48 2011 +0300| [2bc38992a6bdcf4eea681b390e199b2874124b12] | committer: Rémi Denis-Courmont
intf-add: do not list CLI if stdin is not a TTY (fix #4955)
(cherry picked from commit 8ac466488795c555fb32978509eb62df40ad57f0)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=2bc38992a6bdcf4eea681b390e199b2874124b12
---
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 00871e4..c88ecbe 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -87,10 +87,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 Interface");
var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text );
More information about the vlc-commits
mailing list