* view.c (do_view_init): Close fd if it is unused.

This commit is contained in:
Andrew V. Samoilov 2002-05-15 14:44:54 +00:00
parent e262f0a0dc
commit a876d1a17d
2 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,11 @@
2002-05-15 Andrew V. Samoilov <kai@cmail.ru>
* view.c (do_view_init): Close fd if it is unused.
2002-05-14 Andrew V. Samoilov <kai@cmail.ru>
* Makefile.am (VFSLIB): Add ../vfs/samba/libsamba.a
if USE_WITH_SAMBA is true.
if USE_SAMBA_FS is true.
2002-05-07 Pavel Roskin <proski@gnu.org>

View File

@ -569,9 +569,11 @@ do_view_init (WView *view, char *_command, const char *_file, int start_line)
}
}
if (_command && (view->viewer_magic_flag || _file[0] == '\0'))
if (_command && (view->viewer_magic_flag || _file[0] == '\0')) {
error = init_growing_view (view, _command, view->filename);
else
if (fd != -1)
mc_close (fd);
} else
error = load_view_file (view, fd);
finish: