Win32: simplify.

Sanitization done by the removed code is already performed
by CommandLineToArgvW.
This commit is contained in:
whitequark 2016-12-06 17:32:06 +00:00
parent 6fcf1bbe79
commit 374d1b5e7f

View File

@ -1485,12 +1485,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
// A filename may have been specified on the command line; if so, then // A filename may have been specified on the command line; if so, then
// strip any quotation marks, and make it absolute. // strip any quotation marks, and make it absolute.
if(args.size() >= 2) { if(args.size() >= 2) {
std::string filename = args[1]; SS.OpenFile(PathFromCurrentDirectory(args[1]));
if(filename[0] == '\"' && filename[filename.length() - 1] == '\"') {
filename.erase(0, 1);
filename.erase(filename.length() - 1, 1);
}
SS.OpenFile(PathFromCurrentDirectory(filename));
} }
// Repaint one more time, after we've set everything up. // Repaint one more time, after we've set everything up.