From John Ivar Haugland & Robert Osfield, fix for bug in VisualStudio where it adds an redundent '/n' on the end of the command line arguments for no reason.

This commit is contained in:
Robert Osfield
2010-11-01 17:19:39 +00:00
parent cc93824605
commit 112c272452

View File

@@ -197,6 +197,16 @@ ArgumentParser::ArgumentParser(int* argc,char **argv):
}
}
#endif
#ifdef WIN32
// Remove linefeed from last argument if it exist
char* lastline = argc==0 ? 0 : _argv[*argc-1];
if (lastline)
{
int len = strlen(lastline);
if (len>0 && lastline[len-1] == '\n') lastline[len-1]= '\0';
}
#endif
}
std::string ArgumentParser::getApplicationName() const