do_last_file(), do_help_void(), and do_browser_help(); changes
to do_browser(), parse_browser_input(), shortcut_init(),
do_help(), and help_init(). (DLR)
+ - Open all files in binary mode for consistency and robustness.
+ Changes to load_history() and do_rcfile(). (DLR)
- files.c:
write_file()
- Don't free backupname before displaying it in a statusbar error
/* Assume do_rcfile() has reported a missing home directory. */
if (nanohist != NULL) {
- FILE *hist = fopen(nanohist, "r");
+ FILE *hist = fopen(nanohist, "rb");
if (hist == NULL) {
if (errno != ENOENT) {
#ifdef SYSCONFDIR
nanorc = mallocstrcpy(nanorc, SYSCONFDIR "/nanorc");
/* Try to open the system-wide nanorc. */
- rcstream = fopen(nanorc, "r");
+ rcstream = fopen(nanorc, "rb");
if (rcstream != NULL)
parse_rcfile(rcstream);
#endif
else {
nanorc = charealloc(nanorc, strlen(homedir) + 9);
sprintf(nanorc, "%s/.nanorc", homedir);
- rcstream = fopen(nanorc, "r");
+ rcstream = fopen(nanorc, "rb");
if (rcstream == NULL) {
/* Don't complain about the file's not existing. */