notepad: Don't prompt to save empty Untitled file.
diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index 45d0c75..e19e4d6 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -297,7 +297,9 @@
int nResult;
static const WCHAR empty_strW[] = { 0 };
- if (SendMessageW(Globals.hEdit, EM_GETMODIFY, 0, 0))
+ nResult=GetWindowTextLengthW(Globals.hEdit);
+ if (SendMessageW(Globals.hEdit, EM_GETMODIFY, 0, 0) &&
+ (nResult || Globals.szFileName[0]))
{
/* prompt user to save changes */
nResult = AlertFileNotSaved(Globals.szFileName);