From 87a871efe49a5b976f1b56fd61b17378e1be01f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Fri, 5 Sep 2008 12:48:33 +0200 Subject: [PATCH] notepad: Only append .txt to missing files without a dot in them. --- programs/notepad/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/notepad/main.c b/programs/notepad/main.c index f231f207d00..a9d3c3b1512 100644 --- a/programs/notepad/main.c +++ b/programs/notepad/main.c @@ -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;