Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9372 in orxonox.OLD


Ignore:
Timestamp:
Jul 20, 2006, 11:44:25 PM (18 years ago)
Author:
bensch
Message:

orxonox/proxy: fixed a bug, that prevented empty shell-completions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/shell/shell_command.cc

    r9371 r9372  
    119119
    120120    CmdList::const_iterator elem;
    121     for (elem = cmdClass->commandList.begin(); elem != cmdClass->commandList.end(); elem++)
    122       if (commandName == (*elem)->getName())
    123         return (*elem);
     121    for (unsigned int i = 0; i < cmdClass->commandList.size(); i++)
     122    {
     123      if (commandName == cmdClass->commandList[i]->getName())
     124        return (cmdClass->commandList[i]);
     125    }
    124126    return NULL;
    125127  }
     
    137139    if (likely(checkClass != NULL))
    138140      return ShellCommand::getCommand(commandName, checkClass);
    139     return NULL;
     141    else
     142      return NULL;
    140143  }
    141144
     
    149152  const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine, unsigned int& paramBegin, std::vector<BaseObject*>* boList)
    150153  {
    151     return ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin);
     154    return ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin, boList);
    152155  }
    153156
     
    199202      {
    200203        // Search for Objects.
    201         retCmd = ShellCommand::getCommand(strings[1], cmdClass);
     204        retCmd = ShellCommand::getCommand((strings.size() > 1) ? strings[1] : "", cmdClass);
    202205        if (retCmd != NULL)
    203206        {
     
    210213      if (retCmd == NULL && strings.size() >= 2)
    211214      {
    212         retCmd = ShellCommand::getCommand(strings[2], cmdClass);
     215        retCmd = ShellCommand::getCommand((strings.size() > 2) ? strings[2] : "", cmdClass);
    213216        if (retCmd != NULL)
    214217        {
Note: See TracChangeset for help on using the changeset viewer.