[vlc-commits] cli: simplify

Rémi Denis-Courmont git at videolan.org
Sat Oct 17 20:36:02 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 17 16:30:16 2020 +0300| [43fbb54d3946e69032d041e5258bcb4763845c71] | committer: Rémi Denis-Courmont

cli: simplify

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

 modules/control/cli/cli.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/modules/control/cli/cli.c b/modules/control/cli/cli.c
index 7f2f570a62..e06c72bb16 100644
--- a/modules/control/cli/cli.c
+++ b/modules/control/cli/cli.c
@@ -270,6 +270,9 @@ static void Process(intf_thread_t *intf, const char *line)
     /* Skip heading spaces */
     const char *cmd = line + strspn(line, " ");
 
+    if (*cmd == '\0')
+        return; /* Ignore empty line */
+
     /* Split psz_cmd at the first space and make sure that
      * psz_arg is valid */
     char *arg = strchr(cmd, ' ');
@@ -298,18 +301,7 @@ static void Process(intf_thread_t *intf, const char *line)
             return;
         }
 
-    /* misc menu commands */
-        switch (cmd[0])
-        {
-            case '\0': /* Ignore empty lines */
-                break;
-
-            default:
-                msg_print(intf,
-                          _("Unknown command `%s'. Type `help' for help."),
-                          cmd);
-                break;
-        }
+    msg_print(intf, _("Unknown command `%s'. Type `help' for help."), cmd);
 }
 
 



More information about the vlc-commits mailing list