Small tidy up of previous patch
authorMarco Costalba <mcostalba@gmail.com>
Fri, 10 Jul 2009 17:50:43 +0000 (18:50 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 10 Jul 2009 17:50:43 +0000 (18:50 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/uci.cpp

index 1f1ba096ca6aa38edf39889d5e359dc07c96f9e9..36848d83cd387b4f91ecdbc3df3bfb8f80aa021e 100644 (file)
@@ -242,12 +242,10 @@ namespace {
         }
         if (token == "value")
         {
-            // Skip whitespace. There should be a better way to do this, but
-            // I don't know how...
-            while(isspace(uip.get()));
-            uip.unget();
+            // Reads until end of line and left trim white space
+            getline(uip, token);
+            token.erase(0, token.find_first_not_of(" \n\r\t"));
 
-            getline(uip, token); // reads until end of line
             set_option_value(name, token);
         } else
             push_button(name);