CVS code -
-search.c:
+- files.c:
+ do_writeout()
+ - Prompt the user if we're trying to save an existing file under
+ a different name. (DLR; suggested by Jean-Philippe Guérard)
+- search.c:
do_replace_loop()
- Fix potential infinite loop when doing a forward regex replace
of "$". (DLR; found by Mike Frysinger)
if (append == 0 && strcmp(answer, filename)) {
struct stat st;
- if (!stat(answer, &st)) {
+ if (!stat(answer, &st))
i = do_yesno(0, 0, _("File exists, OVERWRITE ?"));
+ else if (filename[0] != '\0')
+ i = do_yesno(0, 0, _("Save file under DIFFERENT NAME ?"));
+ else
+ i = 1;
- if (i == 0 || i == -1)
- continue;
- }
+ if (i == 0 || i == -1)
+ continue;
}
#ifndef NANO_SMALL