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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user