mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Merge branch '2137_panel_encoding_without_vfs'
* 2137_panel_encoding_without_vfs: Get rid of some '#ifdef ENABLE_VFS' conditions. Fix of file panel encoding change w/o VFS support. Cleanup of includes in VFS sources. Ticket #2137: cannot change panel encoding without VFS support
This commit is contained in:
commit
16d17edb25
@ -39,9 +39,5 @@ libmc_la_LIBADD = \
|
||||
search/libsearch.la \
|
||||
strutil/libmcstrutil.la \
|
||||
skin/libmcskin.la \
|
||||
tty/libmctty.la
|
||||
|
||||
if ENABLE_VFS
|
||||
libmc_la_LIBADD += vfs/mc-vfs/libvfs-mc.la
|
||||
endif
|
||||
|
||||
tty/libmctty.la \
|
||||
vfs/mc-vfs/libvfs-mc.la
|
||||
|
@ -42,10 +42,6 @@
|
||||
|
||||
#include "lib/vfs/mc-vfs/vfs.h"
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
#include "lib/vfs/mc-vfs/gc.h"
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
#include "tty.h"
|
||||
#include "tty-internal.h" /* mouse_enabled */
|
||||
#include "mouse.h"
|
||||
|
24
lib/util.c
24
lib/util.c
@ -894,30 +894,6 @@ strip_ctrl_codes (char *s)
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
#ifndef ENABLE_VFS
|
||||
char *
|
||||
get_current_wd (char *buffer, size_t size)
|
||||
{
|
||||
char *p;
|
||||
size_t len;
|
||||
|
||||
p = g_get_current_dir ();
|
||||
len = strlen (p) + 1;
|
||||
|
||||
if (len > size)
|
||||
{
|
||||
g_free (p);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy (buffer, p, len);
|
||||
g_free (p);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
#endif /* !ENABLE_VFS */
|
||||
|
||||
enum compression_type
|
||||
get_compression_type (int fd, const char *name)
|
||||
{
|
||||
|
@ -164,7 +164,6 @@ void custom_canonicalize_pathname (char *, CANON_PATH_FLAGS);
|
||||
void canonicalize_pathname (char *);
|
||||
|
||||
/* Misc Unix functions */
|
||||
char *get_current_wd (char *buffer, size_t size);
|
||||
int my_mkdir (const char *s, mode_t mode);
|
||||
int my_rmdir (const char *s);
|
||||
|
||||
|
@ -21,8 +21,8 @@ BASICFILES = \
|
||||
vfs.c vfs.h vfs-impl.h \
|
||||
direntry.c xdirentry.h \
|
||||
utilvfs.c utilvfs.h \
|
||||
local.c local.h \
|
||||
gc.c gc.h
|
||||
gc.c gc.h \
|
||||
local.c local.h
|
||||
|
||||
CPIOFILES = cpio.c
|
||||
TARFILES = tar.c
|
||||
@ -102,11 +102,7 @@ distclean-local:
|
||||
(cd samba && $(MAKE) distclean) \
|
||||
else :; fi
|
||||
|
||||
if ENABLE_VFS
|
||||
noinst_LTLIBRARIES = libvfs-mc.la
|
||||
else
|
||||
noinst_LTLIBRARIES =
|
||||
endif
|
||||
|
||||
SAMBA_DIST = \
|
||||
Makefile.in \
|
||||
|
@ -32,14 +32,12 @@
|
||||
#include "lib/global.h"
|
||||
#include "lib/unixcompat.h"
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
#include "vfs.h"
|
||||
#include "src/wtools.h" /* message() */
|
||||
|
||||
#include "utilvfs.h"
|
||||
#include "vfs-impl.h"
|
||||
#include "gc.h" /* vfs_rmstamp */
|
||||
#include "utilvfs.h"
|
||||
#include "xdirentry.h"
|
||||
#include "gc.h" /* vfs_rmstamp */
|
||||
|
||||
enum {
|
||||
STATUS_START,
|
||||
|
@ -39,15 +39,15 @@
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "lib/tty/tty.h" /* enable/disable interrupt key */
|
||||
#include "lib/util.h" /* concat_dir_and_file */
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
#include "vfs.h"
|
||||
|
||||
#include "utilvfs.h"
|
||||
#include "vfs-impl.h"
|
||||
#include "gc.h" /* vfs_rmstamp */
|
||||
#include "utilvfs.h"
|
||||
#include "xdirentry.h"
|
||||
#include "gc.h" /* vfs_rmstamp */
|
||||
|
||||
#define CALL(x) if (MEDATA->x) MEDATA->x
|
||||
|
||||
@ -1230,6 +1230,22 @@ vfs_s_init_class (struct vfs_class *vclass, struct vfs_s_subclass *sub)
|
||||
sub->dir_uptodate = vfs_s_dir_uptodate;
|
||||
}
|
||||
|
||||
/* Find VFS id for given directory name */
|
||||
vfsid
|
||||
vfs_getid (struct vfs_class *vclass, const char *dir)
|
||||
{
|
||||
char *dir1;
|
||||
vfsid id = NULL;
|
||||
|
||||
/* append slash if needed */
|
||||
dir1 = concat_dir_and_file (dir, "");
|
||||
if (vclass->getid)
|
||||
id = (*vclass->getid) (vclass, dir1);
|
||||
|
||||
g_free (dir1);
|
||||
return id;
|
||||
}
|
||||
|
||||
/* ----------- Utility functions for networked filesystems -------------- */
|
||||
|
||||
#ifdef ENABLE_VFS_NET
|
||||
|
@ -50,12 +50,11 @@
|
||||
#include "lib/fileloc.h"
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
#include "src/main.h" /* shell */
|
||||
#include "src/execute.h" /* For shell_execute */
|
||||
|
||||
#include "utilvfs.h"
|
||||
#include "vfs.h"
|
||||
#include "vfs-impl.h"
|
||||
#include "utilvfs.h"
|
||||
#include "gc.h" /* vfs_rmstamp */
|
||||
|
||||
#undef ERRNOR
|
||||
|
@ -63,12 +63,13 @@
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
#include "utilvfs.h"
|
||||
#include "xdirentry.h"
|
||||
#include "vfs.h"
|
||||
|
||||
#include "vfs-impl.h"
|
||||
#include "gc.h" /* vfs_stamp_create */
|
||||
#include "utilvfs.h"
|
||||
#include "netutil.h"
|
||||
#include "xdirentry.h"
|
||||
#include "gc.h" /* vfs_stamp_create */
|
||||
|
||||
#include "fish.h"
|
||||
#include "fishdef.h"
|
||||
|
||||
|
@ -94,13 +94,14 @@ What to do with this?
|
||||
#include "src/history.h"
|
||||
#include "src/setup.h" /* for load_anon_passwd */
|
||||
|
||||
#include "utilvfs.h"
|
||||
#include "xdirentry.h"
|
||||
#include "vfs.h"
|
||||
#include "vfs-impl.h"
|
||||
#include "gc.h" /* vfs_stamp_create */
|
||||
#include "utilvfs.h"
|
||||
#include "netutil.h"
|
||||
#include "xdirentry.h"
|
||||
#include "gc.h" /* vfs_stamp_create */
|
||||
|
||||
#include "ftpfs.h"
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
# define MAXHOSTNAMELEN 64
|
||||
#endif
|
||||
|
@ -48,10 +48,10 @@
|
||||
#include "src/layout.h" /* get_current_type(), get_other_type() */
|
||||
|
||||
#include "vfs-impl.h"
|
||||
#include "gc.h"
|
||||
|
||||
#include "utilvfs.h"
|
||||
|
||||
#include "gc.h"
|
||||
|
||||
int vfs_timeout = 60; /* VFS timeout in seconds */
|
||||
|
||||
static struct vfs_stamping *stamps;
|
||||
@ -121,23 +121,6 @@ vfs_rmstamp (struct vfs_class *v, vfsid id)
|
||||
}
|
||||
|
||||
|
||||
/* Find VFS id for given directory name */
|
||||
vfsid
|
||||
vfs_getid (struct vfs_class *vclass, const char *dir)
|
||||
{
|
||||
char *dir1;
|
||||
vfsid id = NULL;
|
||||
|
||||
/* append slash if needed */
|
||||
dir1 = concat_dir_and_file (dir, "");
|
||||
if (vclass->getid)
|
||||
id = (*vclass->getid) (vclass, dir1);
|
||||
|
||||
g_free (dir1);
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
vfs_stamp_path (const char *path)
|
||||
{
|
||||
|
@ -20,8 +20,6 @@ struct vfs_stamping
|
||||
void vfs_stamp (struct vfs_class *vclass, vfsid id);
|
||||
void vfs_rmstamp (struct vfs_class *vclass, vfsid id);
|
||||
void vfs_stamp_create (struct vfs_class *vclass, vfsid id);
|
||||
void vfs_timeout_handler (void);
|
||||
int vfs_timeouts (void);
|
||||
vfsid vfs_getid (struct vfs_class *vclass, const char *dir);
|
||||
void vfs_gc_done (void);
|
||||
|
||||
|
@ -14,11 +14,9 @@
|
||||
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
|
||||
#include "vfs-impl.h"
|
||||
#include "utilvfs.h"
|
||||
#include "vfs.h"
|
||||
|
||||
#include "local.h"
|
||||
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "netutil.h"
|
||||
|
||||
volatile sig_atomic_t got_sigpipe = 0;
|
||||
|
@ -43,15 +43,14 @@
|
||||
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
#include "src/wtools.h" /* D_ERROR, D_NORMAL */
|
||||
#include "src/main.h" /* mc_home */
|
||||
#include "src/execute.h" /* EXECUTE_AS_SHELL */
|
||||
|
||||
#include "utilvfs.h"
|
||||
#include "vfs.h"
|
||||
#include "vfs-impl.h"
|
||||
#include "gc.h" /* vfs_stamp_create */
|
||||
#include "utilvfs.h"
|
||||
#include "local.h"
|
||||
#include "gc.h" /* vfs_stamp_create */
|
||||
|
||||
struct cachedfile {
|
||||
char *name, *cache;
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
|
||||
#undef PACKAGE_BUGREPORT
|
||||
#undef PACKAGE_NAME
|
||||
|
@ -43,12 +43,11 @@
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
#include "vfs.h"
|
||||
|
||||
#include "vfs-impl.h"
|
||||
#include "utilvfs.h"
|
||||
#include "gc.h" /* vfs_rmstamp */
|
||||
#include "xdirentry.h"
|
||||
#include "gc.h" /* vfs_rmstamp */
|
||||
|
||||
static struct vfs_class vfs_tarfs_ops;
|
||||
|
||||
|
@ -57,10 +57,11 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
|
||||
#include "utilvfs.h"
|
||||
#include "vfs.h"
|
||||
#include "vfs-impl.h"
|
||||
|
||||
struct deleted_info
|
||||
|
@ -38,10 +38,10 @@
|
||||
#include "lib/global.h"
|
||||
#include "lib/unixcompat.h"
|
||||
|
||||
#include "src/wtools.h"
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/history.h"
|
||||
|
||||
#include "vfs.h"
|
||||
#include "vfs-impl.h"
|
||||
#include "utilvfs.h"
|
||||
|
||||
/** Get current username
|
||||
|
@ -7,8 +7,6 @@
|
||||
#ifndef MC_VFS_IMPL_H
|
||||
#define MC_VFS_IMPL_H
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@ -111,6 +109,8 @@ char *vfs_path (const char *path);
|
||||
/* vfs/direntry.c: */
|
||||
void *vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode);
|
||||
|
||||
vfsid vfs_getid (struct vfs_class *vclass, const char *dir);
|
||||
|
||||
#ifdef ENABLE_VFS_CPIO
|
||||
void init_cpiofs (void);
|
||||
#endif
|
||||
@ -133,6 +133,4 @@ void init_ftpfs (void);
|
||||
void init_fish (void);
|
||||
#endif
|
||||
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
#endif /* MC_VFS_IMPL_H */
|
||||
|
@ -52,16 +52,17 @@
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/strutil.h"
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
#include "src/charsets.h"
|
||||
#endif
|
||||
|
||||
#include "src/wtools.h" /* message() */
|
||||
#include "src/main.h" /* print_vfs_message */
|
||||
#include "src/main.h" /* cd_symlinks */
|
||||
|
||||
#include "vfs-impl.h"
|
||||
#include "utilvfs.h"
|
||||
#include "gc.h"
|
||||
#include "vfs.h"
|
||||
|
||||
#ifdef ENABLE_VFS_NET
|
||||
#include "netutil.h"
|
||||
#endif
|
||||
@ -71,6 +72,7 @@
|
||||
#ifdef ENABLE_VFS_SMB
|
||||
#include "smbfs.h"
|
||||
#endif
|
||||
|
||||
#include "local.h"
|
||||
|
||||
#if defined(_AIX) && !defined(NAME_MAX)
|
||||
|
@ -24,7 +24,8 @@ typedef enum
|
||||
VFSF_NOLINKS = 1 << 1 /* Hard links not supported */
|
||||
} vfs_class_flags_t;
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
void vfs_init (void);
|
||||
void vfs_shut (void);
|
||||
|
||||
#if defined (ENABLE_VFS_FTP) || defined (ENABLE_VFS_FISH) || defined (ENABLE_VFS_SMB)
|
||||
#define ENABLE_VFS_NET 1
|
||||
@ -44,8 +45,8 @@ extern int vfs_timeout;
|
||||
extern int use_netrc;
|
||||
#endif
|
||||
|
||||
void vfs_init (void);
|
||||
void vfs_shut (void);
|
||||
void vfs_timeout_handler (void);
|
||||
int vfs_timeouts (void);
|
||||
void vfs_expire (int now);
|
||||
|
||||
gboolean vfs_current_is_local (void);
|
||||
@ -102,107 +103,6 @@ void vfs_release_path (const char *dir);
|
||||
|
||||
void vfs_fill_names (fill_names_f);
|
||||
|
||||
#else /* ENABLE_VFS */
|
||||
|
||||
/* Only the routines outside of the VFS module need the emulation macros */
|
||||
|
||||
#define vfs_init() do { } while (0)
|
||||
#define vfs_shut() do { } while (0)
|
||||
#define vfs_current_is_local() (TRUE)
|
||||
#define vfs_file_is_local(x) (TRUE)
|
||||
#define vfs_strip_suffix_from_filename(x) g_strdup(x)
|
||||
#define vfs_get_class(x) (struct vfs_class *)(NULL)
|
||||
#define vfs_translate_url(s) g_strdup(s)
|
||||
#define vfs_file_class_flags(x) (VFSF_LOCAL)
|
||||
#define vfs_release_path(x)
|
||||
#define vfs_timeout_handler() do { } while (0)
|
||||
#define vfs_timeouts() 0
|
||||
|
||||
#define mc_getlocalcopy(x) vfs_canon(x)
|
||||
#define mc_read read
|
||||
#define mc_write write
|
||||
#define mc_utime utime
|
||||
#define mc_readlink readlink
|
||||
#define mc_ungetlocalcopy(x,y,z) do { } while (0)
|
||||
#define mc_close close
|
||||
#define mc_lseek lseek
|
||||
#define mc_opendir opendir
|
||||
#define mc_readdir readdir
|
||||
#define mc_closedir closedir
|
||||
#define mc_stat stat
|
||||
#define mc_mknod mknod
|
||||
#define mc_link link
|
||||
#define mc_mkdir mkdir
|
||||
#define mc_rmdir rmdir
|
||||
#define mc_fstat fstat
|
||||
#define mc_lstat lstat
|
||||
#define mc_symlink symlink
|
||||
#define mc_rename rename
|
||||
#define mc_chmod chmod
|
||||
#define mc_chown chown
|
||||
#define mc_chdir chdir
|
||||
#define mc_unlink unlink
|
||||
#define mc_open open
|
||||
#define mc_get_current_wd(x,size) get_current_wd (x, size)
|
||||
|
||||
static inline int mc_setctl (const char *path, int ctlop, void *arg)
|
||||
{
|
||||
(void) path;
|
||||
(void) ctlop;
|
||||
(void) arg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int mc_ctl (int fd, int ctlop, void *arg)
|
||||
{
|
||||
(void) fd;
|
||||
(void) ctlop;
|
||||
(void) arg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline const char *vfs_get_encoding (const char *path)
|
||||
{
|
||||
(void) path;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* return new string */
|
||||
static inline char *vfs_translate_path_n (const char *path)
|
||||
{
|
||||
return ((path == NULL) ? g_strdup ("") : g_strdup (path));
|
||||
}
|
||||
|
||||
static inline char* vfs_canon_and_translate(const char* path)
|
||||
{
|
||||
char *ret_str;
|
||||
|
||||
if (path == NULL)
|
||||
return g_strdup("");
|
||||
|
||||
if (path[0] == PATH_SEP)
|
||||
{
|
||||
char *curr_dir = g_get_current_dir();
|
||||
ret_str = g_strdup_printf("%s" PATH_SEP_STR "%s", curr_dir, path);
|
||||
g_free(curr_dir);
|
||||
}
|
||||
else
|
||||
ret_str = g_strdup(path);
|
||||
|
||||
canonicalize_pathname (ret_str);
|
||||
return ret_str;
|
||||
}
|
||||
|
||||
static inline char *
|
||||
vfs_canon (const char *path)
|
||||
{
|
||||
char *p = g_strdup (path);
|
||||
canonicalize_pathname(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
char *vfs_get_current_dir (void);
|
||||
/* translate path back to terminal encoding, remove all #enc:
|
||||
* every invalid character is replaced with question mark
|
||||
|
@ -9,7 +9,6 @@
|
||||
#define MC_VFS_XDIRENTRY_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define LINK_FOLLOW 15
|
||||
@ -46,6 +45,7 @@ struct vfs_s_super
|
||||
|
||||
union
|
||||
{
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
struct
|
||||
{
|
||||
int sockr, sockw;
|
||||
@ -70,6 +70,8 @@ struct vfs_s_super
|
||||
int host_flags;
|
||||
char *scr_env;
|
||||
} fish;
|
||||
#endif /* ENABLE_VFS_FISH */
|
||||
#ifdef ENABLE_VFS_FTP
|
||||
struct
|
||||
{
|
||||
int sock;
|
||||
@ -91,6 +93,8 @@ struct vfs_s_super
|
||||
*/
|
||||
int ctl_connection_busy;
|
||||
} ftp;
|
||||
#endif /* ENABLE_VFS_FTP */
|
||||
#if defined(ENABLE_VFS_CPIO) || defined(ENABLE_VFS_TAR)
|
||||
struct
|
||||
{
|
||||
int fd;
|
||||
@ -98,6 +102,7 @@ struct vfs_s_super
|
||||
int type; /* Type of the archive */
|
||||
struct defer_inode *deferred; /* List of inodes for which another entries may appear */
|
||||
} arch;
|
||||
#endif /* ENABLE_VFS_CPIO || ENABLE_VFS_TAR */
|
||||
} u;
|
||||
};
|
||||
|
||||
@ -138,15 +143,19 @@ struct vfs_s_fh
|
||||
int linear; /* Is that file open with O_LINEAR? */
|
||||
union
|
||||
{
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
struct
|
||||
{
|
||||
off_t got, total;
|
||||
int append;
|
||||
} fish;
|
||||
#endif /* ENABLE_VFS_FISH */
|
||||
#ifdef ENABLE_VFS_FTP
|
||||
struct
|
||||
{
|
||||
int sock, append;
|
||||
} ftp;
|
||||
#endif /* ENABLE_VFS_FTP */
|
||||
} u;
|
||||
};
|
||||
|
||||
|
@ -48,13 +48,19 @@ AC_DEFUN([MC_ENABLE_VFS_NET],
|
||||
AC_DEFUN([AC_MC_VFS_CHECKS],
|
||||
[
|
||||
vfs_type="normal"
|
||||
enable_vfs_net=no
|
||||
|
||||
AC_ARG_ENABLE([vfs],
|
||||
AC_HELP_STRING([--disable-vfs], [Disable VFS]))
|
||||
AC_HELP_STRING([--disable-vfs], [Disable VFS]),
|
||||
[
|
||||
if test "x$enableval" = "xno"; then
|
||||
enable_vfs=no
|
||||
else
|
||||
enable_vfs=yes
|
||||
fi
|
||||
],
|
||||
[enable_vfs=yes])
|
||||
|
||||
if test x"$enable_vfs" != x"no" ; then
|
||||
enable_vfs="yes"
|
||||
if test x"$enable_vfs" = x"yes" ; then
|
||||
vfs_type="Midnight Commander Virtual Filesystem"
|
||||
AC_MSG_NOTICE([Enabling VFS code])
|
||||
AC_DEFINE(ENABLE_VFS, [1], [Define to enable VFS support])
|
||||
|
@ -3,10 +3,10 @@ AC_DEFUN([AC_MC_VFS_CPIOFS],
|
||||
[
|
||||
AC_ARG_ENABLE([vfs-cpio],
|
||||
AC_HELP_STRING([--enable-vfs-cpio], [Support for cpio filesystem [[yes]]]))
|
||||
if test "$enable_vfs" != "no" -a x"$enable_vfs_cpio" != x"no"; then
|
||||
if test "$enable_vfs" = "yes" -a x"$enable_vfs_cpio" != x"no"; then
|
||||
enable_vfs_cpio="yes"
|
||||
AC_DEFINE([ENABLE_VFS_CPIO], [1], [Support for cpio filesystem])
|
||||
AC_MC_VFS_ADDNAME([cpio])
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_CPIO, [test x"$enable_vfs_cpio" = x"yes"])
|
||||
AM_CONDITIONAL(ENABLE_VFS_CPIO, [test "$enable_vfs" = "yes" -a x"$enable_vfs_cpio" = x"yes"])
|
||||
])
|
||||
|
@ -24,11 +24,11 @@ AC_DEFUN([AC_MC_VFS_EXTFS],
|
||||
[
|
||||
AC_ARG_ENABLE([vfs-extfs],
|
||||
AC_HELP_STRING([--enable-vfs-extfs], [Support for extfs filesystem [[yes]]]))
|
||||
if test "$enable_vfs" != "no" -a x"$enable_vfs_extfs" != x"no"; then
|
||||
if test "$enable_vfs" = "yes" -a x"$enable_vfs_extfs" != x"no"; then
|
||||
AC_MC_EXTFS_CHECKS
|
||||
enable_vfs_extfs="yes"
|
||||
AC_MC_VFS_ADDNAME([extfs])
|
||||
AC_DEFINE([ENABLE_VFS_EXTFS], [1], [Support for extfs])
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_EXTFS, [test x"$enable_vfs_extfs" = x"yes"])
|
||||
AM_CONDITIONAL(ENABLE_VFS_EXTFS, [test "$enable_vfs" = "yes" -a x"$enable_vfs_extfs" = x"yes"])
|
||||
])
|
||||
|
@ -3,10 +3,10 @@ AC_DEFUN([AC_MC_VFS_FISH],
|
||||
[
|
||||
AC_ARG_ENABLE([vfs-fish],
|
||||
AC_HELP_STRING([--enable-vfs-fish], [Support for FISH filesystem [[yes]]]))
|
||||
if test "$enable_vfs" != "no" -a "x$enable_vfs_fish" != xno; then
|
||||
if test "$enable_vfs" = "yes" -a "x$enable_vfs_fish" != xno; then
|
||||
enable_vfs_fish="yes"
|
||||
AC_MC_VFS_ADDNAME([fish])
|
||||
AC_DEFINE([ENABLE_VFS_FISH], [1], [Support for FISH vfs])
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_FISH, [test x"$enable_vfs_fish" = x"yes"])
|
||||
AM_CONDITIONAL(ENABLE_VFS_FISH, [test "$enable_vfs" = "yes" -a x"$enable_vfs_fish" = x"yes"])
|
||||
])
|
||||
|
@ -8,5 +8,5 @@ AC_DEFUN([AC_MC_VFS_FTP],
|
||||
AC_MC_VFS_ADDNAME([ftp])
|
||||
AC_DEFINE([ENABLE_VFS_FTP], [1], [Support for FTP (classic)])
|
||||
fi
|
||||
AM_CONDITIONAL([ENABLE_VFS_FTP], [test x"$enable_vfs_ftp" = x"yes"])
|
||||
AM_CONDITIONAL([ENABLE_VFS_FTP], [test "$enable_vfs" = "yes" -a x"$enable_vfs_ftp" = x"yes"])
|
||||
])
|
||||
|
@ -12,7 +12,7 @@ AC_DEFUN([AC_MC_VFS_SMB],
|
||||
],
|
||||
[enable_vfs_smb=no])
|
||||
|
||||
if test "$enable_vfs" != "no" -a x"$enable_vfs_smb" != x"no"; then
|
||||
if test "$enable_vfs" = "yes" -a x"$enable_vfs_smb" != x"no"; then
|
||||
enable_vfs_smb="yes"
|
||||
AC_MC_VFS_ADDNAME([smb])
|
||||
AC_DEFINE([ENABLE_VFS_SMB], [1], [Define to enable VFS over SMB])
|
||||
@ -22,5 +22,5 @@ AC_DEFUN([AC_MC_VFS_SMB],
|
||||
AC_CONFIG_SUBDIRS([lib/vfs/mc-vfs/samba])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([ENABLE_VFS_SMB], [test x"$enable_vfs_smb" = x"yes"])
|
||||
AM_CONDITIONAL([ENABLE_VFS_SMB], [test "$enable_vfs" = "yes" -a x"$enable_vfs_smb" = x"yes"])
|
||||
])
|
||||
|
@ -3,10 +3,10 @@ AC_DEFUN([AC_MC_VFS_SFS],
|
||||
[
|
||||
AC_ARG_ENABLE([vfs-sfs],
|
||||
AC_HELP_STRING([--enable-vfs-sfs], [Support for sfs filesystem [[yes]]]))
|
||||
if test "$enable_vfs" != "no" -a x"$enable_vfs_sfs" != x"no"; then
|
||||
if test "$enable_vfs" = "yes" -a x"$enable_vfs_sfs" != x"no"; then
|
||||
enable_vfs_sfs="yes"
|
||||
AC_MC_VFS_ADDNAME([sfs])
|
||||
AC_DEFINE([ENABLE_VFS_SFS], [1], [Support for sfs])
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_SFS, [test x"$enable_vfs_sfs" = x"yes"])
|
||||
AM_CONDITIONAL(ENABLE_VFS_SFS, [test "$enable_vfs" = "yes" -a x"$enable_vfs_sfs" = x"yes"])
|
||||
])
|
||||
|
@ -3,10 +3,10 @@ AC_DEFUN([AC_MC_VFS_TARFS],
|
||||
[
|
||||
AC_ARG_ENABLE([vfs-tar],
|
||||
AC_HELP_STRING([--enable-vfs-tar], [Support for tar filesystem [[yes]]]))
|
||||
if test "$enable_vfs" != "no" -a x"$enable_vfs_tar" != x"no"; then
|
||||
if test "$enable_vfs" = "yes" -a x"$enable_vfs_tar" != x"no"; then
|
||||
enable_vfs_tar="yes"
|
||||
AC_MC_VFS_ADDNAME([tar])
|
||||
AC_DEFINE([ENABLE_VFS_TAR], [1], [Support for tar filesystem])
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_TAR, [test x"$enable_vfs_tar" = x"yes"])
|
||||
AM_CONDITIONAL(ENABLE_VFS_TAR, [test "$enable_vfs" = "yes" -a x"$enable_vfs_tar" = x"yes"])
|
||||
])
|
||||
|
@ -58,7 +58,7 @@ AC_DEFUN([AC_MC_VFS_UNDELFS],
|
||||
],
|
||||
[enable_vfs_undelfs="no"])
|
||||
|
||||
if test x"$enable_vfs" != x"no" -a x"$enable_vfs_undelfs" != x"no"; then
|
||||
if test x"$enable_vfs" = x"yes" -a x"$enable_vfs_undelfs" != x"no"; then
|
||||
MC_UNDELFS_CHECKS
|
||||
|
||||
if test x"$ext2fs_undel" = x"yes"; then
|
||||
@ -71,5 +71,5 @@ AC_DEFUN([AC_MC_VFS_UNDELFS],
|
||||
AC_ERROR([Ext2 libraries not found])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [test x"$enable_vfs_undelfs" = x"yes"])
|
||||
AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [test "$enable_vfs" = "yes" -a x"$enable_vfs_undelfs" = x"yes"])
|
||||
])
|
||||
|
@ -507,12 +507,8 @@ edit_set_filename (WEdit * edit, const char *f)
|
||||
if (!f)
|
||||
f = "";
|
||||
edit->filename = g_strdup (f);
|
||||
if (edit->dir == NULL && *f != PATH_SEP)
|
||||
#ifdef ENABLE_VFS
|
||||
if (edit->dir == NULL && !g_path_is_absolute (f))
|
||||
edit->dir = g_strdup (vfs_get_current_dir ());
|
||||
#else /* ENABLE_VFS */
|
||||
edit->dir = g_get_current_dir ();
|
||||
#endif /* ENABLE_VFS */
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -119,12 +119,10 @@ do_execute (const char *lc_shell, const char *command, int flags)
|
||||
char *new_dir = NULL;
|
||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
char *old_vfs_dir = 0;
|
||||
|
||||
if (!vfs_current_is_local ())
|
||||
old_vfs_dir = g_strdup (vfs_get_current_dir ());
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
if (mc_run_mode == MC_RUN_FULL)
|
||||
save_cwds_stat ();
|
||||
@ -143,11 +141,7 @@ do_execute (const char *lc_shell, const char *command, int flags)
|
||||
do_update_prompt ();
|
||||
|
||||
/* We don't care if it died, higher level takes care of this */
|
||||
#ifdef ENABLE_VFS
|
||||
invoke_subshell (command, VISIBLY, old_vfs_dir ? NULL : &new_dir);
|
||||
#else
|
||||
invoke_subshell (command, VISIBLY, &new_dir);
|
||||
#endif /* !ENABLE_VFS */
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||
@ -190,13 +184,11 @@ do_execute (const char *lc_shell, const char *command, int flags)
|
||||
|
||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
if (old_vfs_dir)
|
||||
{
|
||||
mc_chdir (old_vfs_dir);
|
||||
g_free (old_vfs_dir);
|
||||
}
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
if (mc_run_mode == MC_RUN_FULL)
|
||||
{
|
||||
|
12
src/main.c
12
src/main.c
@ -1426,17 +1426,13 @@ done_mc (void)
|
||||
}
|
||||
done_screen ();
|
||||
|
||||
#ifdef ENABLE_VFS
|
||||
vfs_stamp_path (vfs_get_current_dir ());
|
||||
|
||||
if ((current_panel != NULL)
|
||||
&& (get_current_type () == view_listing))
|
||||
vfs_stamp_path (current_panel->cwd);
|
||||
if ((current_panel != NULL) && (get_current_type () == view_listing))
|
||||
vfs_stamp_path (current_panel->cwd);
|
||||
|
||||
if ((other_panel != NULL)
|
||||
&& (get_other_type () == view_listing))
|
||||
vfs_stamp_path (other_panel->cwd);
|
||||
#endif
|
||||
if ((other_panel != NULL) && (get_other_type () == view_listing))
|
||||
vfs_stamp_path (other_panel->cwd);
|
||||
}
|
||||
|
||||
static cb_ret_t
|
||||
|
@ -2540,7 +2540,7 @@ do_enter_on_file_entry (file_entry * fe)
|
||||
_("Do you really want to execute?"), D_NORMAL, 2, _("&Yes"), _("&No")) != 0)
|
||||
return 1;
|
||||
}
|
||||
#ifdef ENABLE_VFS
|
||||
|
||||
if (!vfs_current_is_local ())
|
||||
{
|
||||
char *tmp;
|
||||
@ -2553,7 +2553,6 @@ do_enter_on_file_entry (file_entry * fe)
|
||||
* was successful */
|
||||
return confirm_execute || (ret == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
char *tmp = name_quote (fe->fname, 0);
|
||||
|
@ -647,8 +647,8 @@ tree_rescan (void *data)
|
||||
WTree *tree = data;
|
||||
int ret;
|
||||
|
||||
if (!tree->selected_ptr || !mc_get_current_wd (old_dir, MC_MAXPATHLEN) ||
|
||||
mc_chdir (tree->selected_ptr->name))
|
||||
if (tree->selected_ptr == NULL || mc_get_current_wd (old_dir, MC_MAXPATHLEN) == NULL
|
||||
|| mc_chdir (tree->selected_ptr->name))
|
||||
return;
|
||||
|
||||
tree_store_rescan (tree->selected_ptr->name);
|
||||
@ -751,7 +751,7 @@ tree_mkdir (WTree * tree)
|
||||
|
||||
if (!tree->selected_ptr)
|
||||
return;
|
||||
if (!mc_get_current_wd (old_dir, MC_MAXPATHLEN))
|
||||
if (mc_get_current_wd (old_dir, MC_MAXPATHLEN) == NULL)
|
||||
return;
|
||||
if (chdir (tree->selected_ptr->name))
|
||||
return;
|
||||
|
@ -295,13 +295,7 @@ mcview_load (mcview_t * view, const char *command, const char *file, int start_l
|
||||
if ((view->workdir == NULL) && (file != NULL))
|
||||
{
|
||||
if (!g_path_is_absolute (file))
|
||||
{
|
||||
#ifdef ENABLE_VFS
|
||||
view->workdir = g_strdup (vfs_get_current_dir ());
|
||||
#else /* ENABLE_VFS */
|
||||
view->workdir = g_get_current_dir ();
|
||||
#endif /* ENABLE_VFS */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* try extract path form filename */
|
||||
@ -313,11 +307,7 @@ mcview_load (mcview_t * view, const char *command, const char *file, int start_l
|
||||
else
|
||||
{
|
||||
g_free (dirname);
|
||||
#ifdef ENABLE_VFS
|
||||
view->workdir = g_strdup (vfs_get_current_dir ());
|
||||
#else /* ENABLE_VFS */
|
||||
view->workdir = g_get_current_dir ();
|
||||
#endif /* ENABLE_VFS */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user