more intelligent filename selection in die()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@109 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
aa44841315
commit
fcf32bf3d1
|
@ -11,6 +11,8 @@ Current CVS:
|
||||||
- nano.c:
|
- nano.c:
|
||||||
main():
|
main():
|
||||||
- TABSIZE now set before first call to edit_refresh (Bill Soudan)
|
- TABSIZE now set before first call to edit_refresh (Bill Soudan)
|
||||||
|
die():
|
||||||
|
- More intelligent emergency-save filename selection (Rob)
|
||||||
- search.c:
|
- search.c:
|
||||||
search_init():
|
search_init():
|
||||||
- Added " (to replace)" statement to end of search string if
|
- Added " (to replace)" statement to end of search string if
|
||||||
|
|
11
nano.c
11
nano.c
|
@ -94,10 +94,15 @@ void die(char *msg, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
/* if we can't save we have REAL bad problems,
|
/* if we can't save we have REAL bad problems,
|
||||||
* but we might as well TRY. FIXME: This should probabally base it
|
* but we might as well TRY. */
|
||||||
* off of the current filename */
|
if(filename[0] == '\0') {
|
||||||
write_file("nano.save", 0);
|
write_file("nano.save", 0);
|
||||||
|
} else {
|
||||||
|
char buf[BUFSIZ];
|
||||||
|
strncpy(buf,filename,BUFSIZ);
|
||||||
|
strncat(buf,".save",BUFSIZ - strlen(buf));
|
||||||
|
write_file(buf, 0);
|
||||||
|
}
|
||||||
/* Restore the old term settings */
|
/* Restore the old term settings */
|
||||||
tcsetattr(0, TCSANOW, &oldterm);
|
tcsetattr(0, TCSANOW, &oldterm);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue