CommandLineParser.cpp
/**
 * argv[0] is the full path to the executed command (exe-File). Strip the path
 * and just leave commandname.exe
 */
argv[0] is the full path to the executed command (exe-File). Strip the path
and just leave commandname.exe
argv [ 0 ] is the full path to the executed command ( exe - File ) . Strip the path and just leave commandname . exe
void CommandLineParser::changeCommandName()
{
  int lastOccurence = -1;
  int pos = 0;
  while (m_argv[0][pos] != '\0')
  {
    if (m_argv[0][pos] == '/' || m_argv[0][pos] == '\\')
      lastOccurence = pos;
    pos++;
  }
  m_argv[0] = &(m_argv[0][lastOccurence+1]);
}
void CommandLineParser :: changeCommandName ( ) { int lastOccurence = -1 ; int pos = 0 ; while ( m_argv [ 0 ] [ pos ] != ' \0 ' ) { if ( m_argv [ 0 ] [ pos ] == ' ' || m_argv [ 0 ] [ pos ] == ' \\ ' ) lastOccurence = pos ; pos ++ ; } m_argv [ 0 ] = & ( m_argv [ 0 ] [ lastOccurence + 1 ] ) ; }
argv[0] is the full path to the executed command (exe-File).
argv [ 0 ] is the full path to the executed command ( exe - File ) .