[nemiver/console: 4/11] Ignore bad tokens



commit 9059f8f1190f4be065ced610f0b24245fd07815e
Author: Fabien Parent <parent f gmail com>
Date:   Fri Mar 2 15:29:29 2012 +0100

    Ignore bad tokens

 src/common/nmv-console.cc |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/common/nmv-console.cc b/src/common/nmv-console.cc
index a480ce7..320244d 100644
--- a/src/common/nmv-console.cc
+++ b/src/common/nmv-console.cc
@@ -304,10 +304,14 @@ struct Console::Priv {
             }
 
             a_buffer[local_index] = '\0';
-            if (command_name.empty ()) {
-                command_name = a_buffer;
-            } else {
-                cmd_argv.push_back (a_buffer);
+            std::string token (a_buffer);
+            if (!token.empty ())
+            {
+                if (command_name.empty ()) {
+                    command_name = token;
+                } else {
+                    cmd_argv.push_back (token);
+                }
             }
             a_buffer += local_index + 1;
             local_index = -1;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]