aboutsummaryrefslogtreecommitdiff
path: root/src/CommandParser.cc
diff options
context:
space:
mode:
authormathias <mathias>2005-03-10 16:51:24 (GMT)
committermathias <mathias>2005-03-10 16:51:24 (GMT)
commit730e398b821b57ad54d188adbf4e59bee19b7594 (patch)
tree1482ac8a0f597a719fecfc2e2c93d0a3b4c6b8a7 /src/CommandParser.cc
parent86797859d467e37b0d4eae0ed9c55c351e3fca63 (diff)
downloadfluxbox-730e398b821b57ad54d188adbf4e59bee19b7594.zip
fluxbox-730e398b821b57ad54d188adbf4e59bee19b7594.tar.bz2
commands with trailing whitespaces were problematic coz the 'argument' was
notempty (eg :NextWorkspace or :PrevWorkspace want to have the 'argument' really empty). now the first thing we do is to remove whitespaces from begin and end of the line.
Diffstat (limited to 'src/CommandParser.cc')
-rw-r--r--src/CommandParser.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/CommandParser.cc b/src/CommandParser.cc
index d4c6a28..ec0ddfe 100644
--- a/src/CommandParser.cc
+++ b/src/CommandParser.cc
@@ -56,6 +56,7 @@ FbTk::Command *CommandParser::parseLine(const string &line) {
56 string command = line; 56 string command = line;
57 string arguments; 57 string arguments;
58 string::size_type first_pos = removeFirstWhitespace(command); 58 string::size_type first_pos = removeFirstWhitespace(command);
59 FbTk::StringUtil::removeTrailingWhitespace(command);
59 string::size_type second_pos = command.find_first_of(" \t", first_pos); 60 string::size_type second_pos = command.find_first_of(" \t", first_pos);
60 if (second_pos != string::npos) { 61 if (second_pos != string::npos) {
61 // ok we have arguments, parsing them here 62 // ok we have arguments, parsing them here
@@ -65,7 +66,6 @@ FbTk::Command *CommandParser::parseLine(const string &line) {
65 } 66 }
66 67
67 // now we have parsed command and arguments 68 // now we have parsed command and arguments
68
69 command = toLower(command); 69 command = toLower(command);
70 70
71 // we didn't find any matching command in default commands, 71 // we didn't find any matching command in default commands,