* direntry.c (vfs_s_open): When opening a file in linear mode,
defer the actual open operation until the first read call.
(vfs_s_read): When reading in linear mode, open the file
on the first read operation.
(vfs_s_lseek): When in linear mode, make sure that seeking is
allowed only before the first read operation.
* ftpfs.c (ftpfs_ctl): Make the code aware of LS_LINEAR_PREOPEN.
* fish.c (fish_ctl): Likewise.
* direntry.c (vfs_s_get_path_mangle): Likewise. "mangle" is in
the name for a reason. Use vfs_s_get_path() instead where the
path should be preserved.
* extfs.c (extfs_get_path_mangle): Likewise.
* sfs.c (sfs_vfmake): Protect against changes in vfs_split().
code reuse. Change all callers.
(vfs_s_getlocalcopy): New implementation. Don't use
mc_def_getlocalcopy(). Use vfs_s_open() to create local copy.
(vfs_s_ungetlocalcopy): New function.
* xdirentry.h: Add new field "flags" to struct vfs_s_subclass.
* extfs.c (extfs_ungetlocalcopy): Don't use
mc_def_ungetlocalcopy() in the dead branch.
* vfs.c (mc_def_getlocalcopy): Make static.
(mc_def_ungetlocalcopy): Likewise.
(vfs_s_free_inode): Remove support for "." and ".." entries.
* ftpfs.c (dir_load): Likewise.
Support for "." and ".." entries was a hack that could make the
cache non-traversible from inodes to the root and cause infinite
loop in vfs_s_fullpath().
Reported by Frédéric L. W. Meunier <lists1@pervalidus.net>
calling vfs_register() in the file defining the VFS class.
* vfs.c (vfs_init): Register cpiofs in cpio.c.
(vfs_register): Rename to vfs_register_class(), remove "static".
* direntry.c (vfs_s_init_class): New function - generic VFS
class registraction for vfs_s descendants.
* cpio.c: Register VFS class locally.
* ftpfs.c (open_archive_int): Use SUP.proxy instead of
SUP.use_proxy.
(open_archive): Set SUP.proxy to ftpfs_proxy_host.
* ftpfs.h: Eliminate unused structures.
(vfs_s_data.file_store): Change second argument
to (vfs_s_fh *fh).
* direntry.c (vfs_s_close): Adjust.
* fish.c (file_store): Likewise.
* ftpfs.c (file_store): Likewise. Use "APPE" if
fh->u.ftp.append is true.
(linear_start): Care about fh->u.ftp.append.
(ftpfs_fh_open): Likewise.
field to ftp struct.
* ftpfs.c (linear_start): Set control_connection_buzy.
(linear_abort): Unset control_connection_buzy.
(ftpfs_fh_open): Don't retrieve file if it is
opened for writting only. Open data connection as
fh->handle and unlink/unset local temporary file
if control connection isn't buzy.
(ftpfs_fh_close): New function to serve opened in
ftpfs_fh_open() data connection. Unset fh->changed
to prevent MEDATA->file_store() call from vfs_s_close().
* direntry.c: Likewise.
* fish.c: Likewise.
* ftpfs.c: Likewise.
* local.c: Likewise.
* tar.c: Likewise.
* utilvfs.h: Don't include <config.h> - it should be included
in all C files instead.
* xdirentry.h: Likewise.
* src/user.c (execute_menu_command): Use mc_mkstemps().
* src/util.c (mc_mkstemps): New function - safely create and
open temporary file. Return the handle and the name.
* src/util.h: Declarations for init_tmpdir() and mc_mkstemps().
Define TMPDIR_DEFAULT and SCRIPT_SUFFIX.
* vfs/direntry.c (vfs_s_open): Use mc_mkstemps. Create and close
temporary file to reserve its name on the filesystem.
(vfs_s_retrieve_file): Use mc_mkstemps().
(g_tempnam): Remove.
* vfs/extfs.c (extfs_open): Use mc_mkstemps().
* vfs/sfs.c (redirect): Likewise.
* vfs/shared_ftp_fish.c (_get_file_entry): Likewise.
(retrieve_file): Likewise.
* vfs/vfs.c (mc_def_getlocalcopy): Likewise.
* vfs/xdirentry.h: Remove declaration of g_tempnam().
Patch by Andrew V. Samoilov <sav@bcs.zp.ua>
* vfs.[ch] (vfs_canon, mc_open, vfs_file_is_local,
mc_(un)?getlocalcopy): added const qualifier
(mc_def_getlocalcopy): tempnam() returns malloc()ed buffer,
so, free() it, not g_free();
(vfs_canon): prepend filename by cwd when tilde '~' cannot be expanded;