From 48929dab4d40f658b964596cd06e74dc3f059451 Mon Sep 17 00:00:00 2001 From: rathnor Date: Sun, 8 Jun 2003 14:54:05 +0000 Subject: small fix --- src/Keys.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Keys.cc b/src/Keys.cc index 48db064..3adf6ec 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Keys.cc,v 1.28 2003/06/08 14:32:28 rathnor Exp $ +//$Id: Keys.cc,v 1.29 2003/06/08 14:54:05 rathnor Exp $ #include "Keys.hh" @@ -297,14 +297,21 @@ bool Keys::load(const char *filename) { last_key->action = m_actionlist[i].action; switch(last_key->action) { case Keys::RESTART: - case Keys::EXECUTE: - last_key->execcommand = - const_cast - (FbTk::StringUtil::strcasestr( + case Keys::EXECUTE: { + // skip past the command + const char *str = + FbTk::StringUtil::strcasestr( linebuffer.c_str(), getActionStr(last_key->action)) - + strlen(getActionStr(last_key->action)) + 1); - break; + + strlen(getActionStr(last_key->action)); + + int i=0; + // skip past any trailing whitespace + while (str[i] == ' ' || str[i] == '\t') + ++i; + + last_key->execcommand = str + i; + } break; case WORKSPACE: case SENDTOWORKSPACE: if (argc + 1 < val.size()) -- cgit v0.11.2