push up read_from_pipes.patch
[nedit-bw.git] / enhanced-fix-stale-Transient-files.patch
blob35233e5e0867db6422bb68eda342fe1eed3d6003
1 ---
3 source/file.c | 5 +----
4 source/window.c | 3 ++-
5 2 files changed, 3 insertions(+), 5 deletions(-)
7 diff --quilt old/source/file.c new/source/file.c
8 --- old/source/file.c
9 +++ new/source/file.c
10 @@ -740,10 +740,11 @@ int CloseFileAndWindow(WindowInfo *windo
11 /* New document, unchanged yet */
12 || (window->fileMissing && window->lastModTime == 0)
13 /* File deleted/modified externally, ignored by user. */
14 || !GetPrefWarnFileMods())))
16 + RemoveBackupFile(window);
17 CloseWindow(window);
18 /* up-to-date windows don't have outstanding backup files to close */
19 } else
21 if (preResponse == PROMPT_SBC_DIALOG_RESPONSE)
22 @@ -1179,14 +1180,10 @@ int WriteBackupFile(WindowInfo *window)
24 void RemoveBackupFile(WindowInfo *window)
26 char name[MAXPATHLEN];
28 - /* Don't delete backup files when backups aren't activated. */
29 - if (window->autoSave == FALSE)
30 - return;
32 backupFileName(window, name, sizeof(name));
33 remove(name);
37 diff --quilt old/source/window.c new/source/window.c
38 --- old/source/window.c
39 +++ new/source/window.c
40 @@ -2416,11 +2416,12 @@ static void modifiedCB(int pos, int nIns
41 SaveUndoInformation(window, pos, nInserted, nDeleted, deletedText);
43 /* Trigger automatic backup if operation or character limits reached */
44 if (window->autoSave &&
45 (window->autoSaveCharCount > AUTOSAVE_CHAR_LIMIT ||
46 - window->autoSaveOpCount > AUTOSAVE_OP_LIMIT)) {
47 + window->autoSaveOpCount > AUTOSAVE_OP_LIMIT) &&
48 + !window->transient) {
49 WriteBackupFile(window);
50 window->autoSaveCharCount = 0;
51 window->autoSaveOpCount = 0;