Changeset 4230 for trunk/console

Show
Ignore:
Timestamp:
09/24/05 10:07:18 (3 years ago)
Author:
phatfil
Message:

fix getting contact when a protocol is specified by the user with extra command arguments

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/console/src/console_menu.cpp

    r4197 r4230  
    701701    return scon; 
    702702  } 
    703  
    704703  string strArg(szArg); 
    705704  string::size_type nPos = strArg.find_last_of("."); 
    706705  if (nPos != string::npos) 
    707706  { 
    708     string strProtocol(strArg, nPos + 1, strArg.size()); 
     707    string::size_type s = strArg.find_last_of(" "); 
     708    string strProtocol(strArg, nPos + 1, (s == string::npos) ? strArg.size() : s - nPos - 1); 
    709709    ProtoPluginsList pl; 
    710710    ProtoPluginsListIter it; 
     
    716716        nPPID = (*it)->PPID(); 
    717717        szArg[strArg.find_last_of(".")] = '\0'; 
     718        string tmp(strArg, 0, nPos); 
     719        tmp.append(strArg, s, strArg.size()); 
     720        szArg = (char *)tmp.c_str(); 
    718721        break; 
    719722      } 
    720723    } 
    721724  } 
    722   
    723725 
    724726  // Check if the alias is quoted