summaryrefslogtreecommitdiff
blob: e6547290cf687e4e60bb952d4572d3e44a4b12c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fix from upstream

diff -ur nano-2.0.1/src/files.c nano-2.0.1-fixed/src/files.c
--- nano-2.0.1/src/files.c	2006-11-09 21:47:11.000000000 -0500
+++ nano-2.0.1-fixed/src/files.c	2006-12-15 00:57:10.000000000 -0500
@@ -1871,8 +1871,9 @@
 	    if (append == OVERWRITE) {
 		char *full_answer = get_full_path(answer);
 		char *full_filename = get_full_path(openfile->filename);
-		bool different_name = (strcmp(full_answer,
-			full_filename) != 0);
+		bool different_name = (strcmp((full_answer == NULL) ?
+			answer : full_answer, (full_filename == NULL) ?
+			openfile->filename : full_filename) != 0);
 		struct stat st;
 		bool name_exists;