wscript: Get extension name by strrchrW instead of strchrW.
This commit is contained in:
parent
b6f934fe33
commit
fa9fec618d
|
@ -361,7 +361,7 @@ static BOOL set_host_properties(const WCHAR *prop)
|
||||||
|
|
||||||
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
|
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
|
||||||
{
|
{
|
||||||
const WCHAR *ext, *filename = NULL;
|
WCHAR *ext, *filepart, *filename = NULL;
|
||||||
IActiveScriptParse *parser;
|
IActiveScriptParse *parser;
|
||||||
IActiveScript *script;
|
IActiveScript *script;
|
||||||
WCHAR **argv;
|
WCHAR **argv;
|
||||||
|
@ -391,14 +391,12 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm
|
||||||
WINE_FIXME("No file name specified\n");
|
WINE_FIXME("No file name specified\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
res = GetFullPathNameW(filename, sizeof(scriptFullName)/sizeof(WCHAR), scriptFullName, NULL);
|
res = GetFullPathNameW(filename, sizeof(scriptFullName)/sizeof(WCHAR), scriptFullName, &filepart);
|
||||||
if(!res || res > sizeof(scriptFullName)/sizeof(WCHAR))
|
if(!res || res > sizeof(scriptFullName)/sizeof(WCHAR))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
ext = strchrW(filename, '.');
|
ext = strrchrW(filepart, '.');
|
||||||
if(!ext)
|
if(!ext || !get_engine_clsid(ext, &clsid)) {
|
||||||
ext = filename;
|
|
||||||
if(!get_engine_clsid(ext, &clsid)) {
|
|
||||||
WINE_FIXME("Could not find engine for %s\n", wine_dbgstr_w(ext));
|
WINE_FIXME("Could not find engine for %s\n", wine_dbgstr_w(ext));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue