notepad: Only append .txt to missing files without a dot in them.

This commit is contained in:
Alexander Nicolaysen Sørnes 2008-09-05 12:48:33 +02:00 committed by Alexandre Julliard
parent ce8e69d4b1
commit 87a871efe4
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@
#include "main.h"
#include "dialog.h"
#include "notepad_res.h"
#include "wine/unicode.h"
NOTEPAD_GLOBALS Globals;
static ATOM aFINDMSGSTRING;
@ -590,7 +591,7 @@ static void HandleCommandLine(LPWSTR cmdline)
static const WCHAR txtW[] = { '.','t','x','t',0 };
/* try to find file with ".txt" extension */
if (!lstrcmp(txtW, cmdline + lstrlen(cmdline) - lstrlen(txtW)))
if (strchrW(PathFindFileNameW(cmdline), '.'))
{
file_exists = FALSE;
file_name = cmdline;