mirror of
https://github.com/reactos/reactos.git
synced 2025-02-21 16:04:57 +00:00
[NOTEPAD] Use full path for non-existent file (#5152)
In HandleCommandLine function, use GetFullPathName API to get the full path of a non-existent file. CORE-18259, CORE-18837
This commit is contained in:
parent
75ac9f8477
commit
136f23578f
1 changed files with 7 additions and 3 deletions
|
@ -462,6 +462,7 @@ static int AlertFileDoesNotExist(LPCTSTR szFileName)
|
|||
static BOOL HandleCommandLine(LPTSTR cmdline)
|
||||
{
|
||||
BOOL opt_print = FALSE;
|
||||
TCHAR szPath[MAX_PATH];
|
||||
|
||||
while (*cmdline == _T(' ') || *cmdline == _T('-') || *cmdline == _T('/'))
|
||||
{
|
||||
|
@ -518,9 +519,11 @@ static BOOL HandleCommandLine(LPTSTR cmdline)
|
|||
}
|
||||
}
|
||||
|
||||
GetFullPathName(file_name, ARRAY_SIZE(szPath), szPath, NULL);
|
||||
|
||||
if (file_exists)
|
||||
{
|
||||
DoOpenFile(file_name);
|
||||
DoOpenFile(szPath);
|
||||
InvalidateRect(Globals.hMainWnd, NULL, FALSE);
|
||||
if (opt_print)
|
||||
{
|
||||
|
@ -530,9 +533,10 @@ static BOOL HandleCommandLine(LPTSTR cmdline)
|
|||
}
|
||||
else
|
||||
{
|
||||
switch (AlertFileDoesNotExist(file_name)) {
|
||||
switch (AlertFileDoesNotExist(file_name))
|
||||
{
|
||||
case IDYES:
|
||||
DoOpenFile(file_name);
|
||||
DoOpenFile(szPath);
|
||||
break;
|
||||
|
||||
case IDNO:
|
||||
|
|
Loading…
Reference in a new issue