From b9ea1b2a219071e7c9cb895b2304f753b910bf3d Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 3 Jun 2018 15:01:47 +0300 Subject: [PATCH 01/25] Ticket #3915: code clean up before 4.8.22 release. (fish_chmod): fix argument type of "%o" format. Signed-off-by: Andrew Borodin --- src/vfs/fish/fish.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c index d14631565..b7f0f049d 100644 --- a/src/vfs/fish/fish.c +++ b/src/vfs/fish/fish.c @@ -1357,7 +1357,8 @@ fish_chmod (const vfs_path_t * vpath, mode_t mode) ret = fish_send_command (path_element->class, super, OPT_FLUSH, SUP->scr_chmod, - "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n", rpath, (int) (mode & 07777)); + "FISH_FILENAME=%s FISH_FILEMODE=%4.4o;\n", rpath, + (unsigned int) (mode & 07777)); g_free (rpath); From 86e9d85f21a6bd52a25241136028ce390060d6c9 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 17 Mar 2018 10:42:51 +0300 Subject: [PATCH 02/25] (extfs_done): fix possible NULL dereference. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index aa69b9db0..b58a18db9 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -1687,6 +1687,9 @@ extfs_done (struct vfs_class *me) ar = first_archive; } + if (extfs_plugins == NULL) + return; + for (i = 0; i < extfs_plugins->len; i++) { extfs_plugin_info_t *info; @@ -1696,8 +1699,7 @@ extfs_done (struct vfs_class *me) g_free (info->prefix); } - if (extfs_plugins != NULL) - g_array_free (extfs_plugins, TRUE); + g_array_free (extfs_plugins, TRUE); } /* --------------------------------------------------------------------------------------------- */ From 5d1284c4a6ae8b9d4925c58729e9652fc7bf743f Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 17 Aug 2016 11:27:57 +0300 Subject: [PATCH 03/25] VFS: (vfs_s_subclass): make the derived class from vfs_class. Signed-off-by: Andrew Borodin --- lib/utilunix.c | 5 ++- lib/vfs/direntry.c | 30 +++++++------ lib/vfs/path.c | 2 +- lib/vfs/vfs.h | 1 - lib/vfs/xdirentry.h | 10 +++-- src/vfs/cpio/cpio.c | 23 +++++----- src/vfs/extfs/extfs.c | 76 ++++++++++++++++--------------- src/vfs/fish/fish.c | 47 ++++++++++---------- src/vfs/ftpfs/ftpfs.c | 41 +++++++++-------- src/vfs/sfs/sfs.c | 58 +++++++++++++----------- src/vfs/sftpfs/file.c | 2 +- src/vfs/sftpfs/init.c | 14 +++--- src/vfs/sftpfs/internal.h | 4 +- src/vfs/sftpfs/vfs_class.c | 84 +++++++++++++++-------------------- src/vfs/sftpfs/vfs_subclass.c | 11 ----- src/vfs/tar/tar.c | 23 +++++----- src/vfs/undelfs/undelfs.c | 45 +++++++++++-------- 17 files changed, 234 insertions(+), 242 deletions(-) diff --git a/lib/utilunix.c b/lib/utilunix.c index 92ddd4cf9..18459c241 100644 --- a/lib/utilunix.c +++ b/lib/utilunix.c @@ -980,8 +980,9 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags) if (vclass != NULL) { - struct vfs_s_subclass *sub = (struct vfs_s_subclass *) vclass->data; - if (sub != NULL && sub->flags & VFS_S_REMOTE) + struct vfs_s_subclass *sub = (struct vfs_s_subclass *) vclass; + + if ((sub->flags & VFS_S_REMOTE) != 0) { s = vfs_prefix; continue; diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 3a0159dd1..0cc0f4ee9 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -785,10 +785,10 @@ vfs_s_setctl (const vfs_path_t * vpath, int ctlop, void *arg) return 1; } case VFS_SETCTL_LOGFILE: - ((struct vfs_s_subclass *) path_element->class->data)->logfile = fopen ((char *) arg, "w"); + VFS_SUBCLASS (path_element)->logfile = fopen ((char *) arg, "w"); return 1; case VFS_SETCTL_FLUSH: - ((struct vfs_s_subclass *) path_element->class->data)->flush = 1; + VFS_SUBCLASS (path_element)->flush = 1; return 1; default: return 0; @@ -1075,9 +1075,7 @@ vfs_get_super_by_vpath (const vfs_path_t * vpath) vfs_path_t *vpath_archive; path_element = vfs_path_get_by_index (vpath, -1); - subclass = (struct vfs_s_subclass *) path_element->class->data; - if (subclass == NULL) - return NULL; + subclass = VFS_SUBCLASS (path_element); vpath_archive = vfs_path_clone (vpath); vfs_path_remove_element_by_index (vpath_archive, -1); @@ -1089,6 +1087,9 @@ vfs_get_super_by_vpath (const vfs_path_t * vpath) goto ret; } + if (subclass->archive_same == NULL) + goto ret; + for (iter = subclass->supers; iter != NULL; iter = g_list_next (iter)) { int i; @@ -1145,8 +1146,8 @@ vfs_s_get_path (const vfs_path_t * vpath, struct vfs_s_super **archive, int flag } super = vfs_s_new_super (path_element->class); + subclass = VFS_SUBCLASS (path_element); - subclass = (struct vfs_s_subclass *) path_element->class->data; if (subclass->open_archive != NULL) { vfs_path_t *vpath_archive; @@ -1237,6 +1238,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) const char *q; struct vfs_s_inode *ino; const vfs_path_element_t *path_element; + struct vfs_s_subclass *s; path_element = vfs_path_get_by_index (vpath, -1); @@ -1250,6 +1252,8 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) return NULL; } + s = VFS_SUBCLASS (path_element); + if (ino == NULL) { char *dirname, *name; @@ -1273,7 +1277,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) ent = vfs_s_generate_entry (path_element->class, name, dir, 0755); ino = ent->ino; vfs_s_insert_entry (path_element->class, dir, ent); - if ((VFSDATA (path_element)->flags & VFS_S_USETMP) != 0) + if ((s->flags & VFS_S_USETMP) != 0) { int tmp_handle; vfs_path_t *tmp_vpath; @@ -1311,7 +1315,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) if (IS_LINEAR (flags)) { - if (VFSDATA (path_element)->linear_start != NULL) + if (s->linear_start != NULL) { vfs_print_message ("%s", _("Starting linear transfer...")); fh->linear = LS_LINEAR_PREOPEN; @@ -1319,9 +1323,6 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) } else { - struct vfs_s_subclass *s; - - s = VFSDATA (path_element); if (s->fh_open != NULL && s->fh_open (path_element->class, fh, flags, mode) != 0) { if (s->fh_free_data != NULL) @@ -1331,7 +1332,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) } } - if ((VFSDATA (path_element)->flags & VFS_S_USETMP) != 0 && fh->ino->localname != NULL) + if ((s->flags & VFS_S_USETMP) != 0 && fh->ino->localname != NULL) { fh->handle = open (fh->ino->localname, NO_LINEAR (flags), mode); if (fh->handle == -1) @@ -1457,9 +1458,10 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino) /* Initialize one of our subclasses - fill common functions */ void -vfs_s_init_class (struct vfs_class *vclass, struct vfs_s_subclass *sub) +vfs_s_init_class (struct vfs_s_subclass *sub) { - vclass->data = sub; + struct vfs_class *vclass = (struct vfs_class *) sub; + vclass->fill_names = vfs_s_fill_names; vclass->open = vfs_s_open; vclass->close = vfs_s_close; diff --git a/lib/vfs/path.c b/lib/vfs/path.c index a9b285b57..e913b685e 100644 --- a/lib/vfs/path.c +++ b/lib/vfs/path.c @@ -461,7 +461,7 @@ vfs_path_from_str_uri_parser (char *path) element->vfs_prefix = g_strdup (vfs_prefix_start); url_delimiter += strlen (VFS_PATH_URL_DELIMITER); - sub = VFSDATA (element); + sub = VFS_SUBCLASS (element); if (sub != NULL && (sub->flags & VFS_S_REMOTE) != 0) { char *slash_pointer; diff --git a/lib/vfs/vfs.h b/lib/vfs/vfs.h index 58ba4b59d..801011f88 100644 --- a/lib/vfs/vfs.h +++ b/lib/vfs/vfs.h @@ -141,7 +141,6 @@ typedef struct vfs_class const char *name; /* "FIles over SHell" */ vfs_class_flags_t flags; const char *prefix; /* "fish:" */ - void *data; /* this is for filesystem's own use */ int verrno; /* can't use errno because glibc2 might define errno as function */ /* *INDENT-OFF* */ diff --git a/lib/vfs/xdirentry.h b/lib/vfs/xdirentry.h index 68073efd2..6eca8526f 100644 --- a/lib/vfs/xdirentry.h +++ b/lib/vfs/xdirentry.h @@ -34,9 +34,9 @@ #define ERRNOR(a, b) do { me->verrno = a; return b; } while (0) -#define MEDATA ((struct vfs_s_subclass *) me->data) +#define MEDATA ((struct vfs_s_subclass *) me) -#define VFSDATA(a) ((a->class != NULL) ? (struct vfs_s_subclass *) a->class->data : NULL) +#define VFS_SUBCLASS(a) ((struct vfs_s_subclass *) a->class) #define FH ((vfs_file_handler_t *) fh) #define FH_SUPER FH->ino->super @@ -116,10 +116,12 @@ typedef struct /* * One of our subclasses (tar, cpio, fish, ftpfs) with data and methods. - * Extends vfs_class. Stored in the "data" field of vfs_class. + * Extends vfs_class. */ struct vfs_s_subclass { + struct vfs_class base; /* base class */ + GList *supers; int inode_counter; vfs_subclass_flags_t flags; /* whether the subclass is remove, read-only etc */ @@ -179,7 +181,7 @@ struct vfs_s_inode *vfs_s_find_inode (struct vfs_class *me, struct vfs_s_inode *vfs_s_find_root (struct vfs_class *me, struct vfs_s_entry *entry); /* outside interface */ -void vfs_s_init_class (struct vfs_class *vclass, struct vfs_s_subclass *sub); +void vfs_s_init_class (struct vfs_s_subclass *sub); const char *vfs_s_get_path (const vfs_path_t * vpath, struct vfs_s_super **archive, int flags); struct vfs_s_super *vfs_get_super_by_vpath (const vfs_path_t * vpath); diff --git a/src/vfs/cpio/cpio.c b/src/vfs/cpio/cpio.c index de55806e7..eb3f299f4 100644 --- a/src/vfs/cpio/cpio.c +++ b/src/vfs/cpio/cpio.c @@ -143,7 +143,8 @@ typedef struct /*** file scope variables ************************************************************************/ -static struct vfs_class vfs_cpiofs_ops; +static struct vfs_s_subclass cpio_subclass; +static struct vfs_class *vfs_cpiofs_ops = (struct vfs_class *) &cpio_subclass; static off_t cpio_position; @@ -828,12 +829,12 @@ cpio_super_same (const vfs_path_element_t * vpath_element, struct vfs_s_super *p && ((cpio_super_data_t *) parc->data)->st.st_mtime < archive_stat->st_mtime) { /* Yes, reload! */ - (*vfs_cpiofs_ops.free) ((vfsid) parc); - vfs_rmstamp (&vfs_cpiofs_ops, (vfsid) parc); + vfs_cpiofs_ops->free ((vfsid) parc); + vfs_rmstamp (vfs_cpiofs_ops, (vfsid) parc); return 2; } /* Hasn't been modified, give it a new timeout */ - vfs_stamp (&vfs_cpiofs_ops, (vfsid) parc); + vfs_stamp (vfs_cpiofs_ops, (vfsid) parc); return 1; } @@ -881,8 +882,6 @@ cpio_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t m void init_cpiofs (void) { - static struct vfs_s_subclass cpio_subclass; - cpio_subclass.flags = VFS_S_READONLY; /* FIXME: cpiofs used own temp files */ cpio_subclass.archive_check = cpio_super_check; cpio_subclass.archive_same = cpio_super_same; @@ -890,12 +889,12 @@ init_cpiofs (void) cpio_subclass.free_archive = cpio_free_archive; cpio_subclass.fh_open = cpio_fh_open; - vfs_s_init_class (&vfs_cpiofs_ops, &cpio_subclass); - vfs_cpiofs_ops.name = "cpiofs"; - vfs_cpiofs_ops.prefix = "ucpio"; - vfs_cpiofs_ops.read = cpio_read; - vfs_cpiofs_ops.setctl = NULL; - vfs_register_class (&vfs_cpiofs_ops); + vfs_s_init_class (&cpio_subclass); + vfs_cpiofs_ops->name = "cpiofs"; + vfs_cpiofs_ops->prefix = "ucpio"; + vfs_cpiofs_ops->read = cpio_read; + vfs_cpiofs_ops->setctl = NULL; + vfs_register_class (vfs_cpiofs_ops); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index b58a18db9..00e262bfa 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -60,6 +60,7 @@ #include "lib/vfs/vfs.h" #include "lib/vfs/utilvfs.h" +#include "lib/vfs/xdirentry.h" #include "lib/vfs/gc.h" /* vfs_rmstamp */ #include "extfs.h" @@ -138,7 +139,9 @@ static GArray *extfs_plugins = NULL; static gboolean errloop; static gboolean notadir; -static struct vfs_class vfs_extfs_ops; +static struct vfs_s_subclass extfs_subclass; +static struct vfs_class *vfs_extfs_ops = (struct vfs_class *) &extfs_subclass; + static struct archive *first_archive = NULL; static int my_errno = 0; @@ -689,7 +692,7 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean { if (strcmp (parc->name, archive_name) == 0) { - vfs_stamp (&vfs_extfs_ops, (vfsid) parc); + vfs_stamp (vfs_extfs_ops, (vfsid) parc); g_free (archive_name); goto return_success; } @@ -960,7 +963,7 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) extfs_info->local_handle = local_handle; /* i.e. we had no open files and now we have one */ - vfs_rmstamp (&vfs_extfs_ops, (vfsid) archive); + vfs_rmstamp (vfs_extfs_ops, (vfsid) archive); archive->fd_usage++; return extfs_info; } @@ -1003,7 +1006,7 @@ extfs_close (void *data) } if (--file->archive->fd_usage == 0) - vfs_stamp_create (&vfs_extfs_ops, file->archive); + vfs_stamp_create (vfs_extfs_ops, file->archive); g_free (data); if (errno_code != 0) @@ -1724,37 +1727,40 @@ extfs_setctl (const vfs_path_t * vpath, int ctlop, void *arg) void init_extfs (void) { - vfs_extfs_ops.name = "extfs"; - vfs_extfs_ops.init = extfs_init; - vfs_extfs_ops.done = extfs_done; - vfs_extfs_ops.fill_names = extfs_fill_names; - vfs_extfs_ops.which = extfs_which; - vfs_extfs_ops.open = extfs_open; - vfs_extfs_ops.close = extfs_close; - vfs_extfs_ops.read = extfs_read; - vfs_extfs_ops.write = extfs_write; - vfs_extfs_ops.opendir = extfs_opendir; - vfs_extfs_ops.readdir = extfs_readdir; - vfs_extfs_ops.closedir = extfs_closedir; - vfs_extfs_ops.stat = extfs_stat; - vfs_extfs_ops.lstat = extfs_lstat; - vfs_extfs_ops.fstat = extfs_fstat; - vfs_extfs_ops.chmod = extfs_chmod; - vfs_extfs_ops.chown = extfs_chown; - vfs_extfs_ops.readlink = extfs_readlink; - vfs_extfs_ops.unlink = extfs_unlink; - vfs_extfs_ops.chdir = extfs_chdir; - vfs_extfs_ops.ferrno = extfs_errno; - vfs_extfs_ops.lseek = extfs_lseek; - vfs_extfs_ops.getid = extfs_getid; - vfs_extfs_ops.nothingisopen = extfs_nothingisopen; - vfs_extfs_ops.free = extfs_free; - vfs_extfs_ops.getlocalcopy = extfs_getlocalcopy; - vfs_extfs_ops.ungetlocalcopy = extfs_ungetlocalcopy; - vfs_extfs_ops.mkdir = extfs_mkdir; - vfs_extfs_ops.rmdir = extfs_rmdir; - vfs_extfs_ops.setctl = extfs_setctl; - vfs_register_class (&vfs_extfs_ops); + memset (&extfs_subclass, 0, sizeof (extfs_subclass)); + vfs_s_init_class (&extfs_subclass); + + vfs_extfs_ops->name = "extfs"; + vfs_extfs_ops->init = extfs_init; + vfs_extfs_ops->done = extfs_done; + vfs_extfs_ops->fill_names = extfs_fill_names; + vfs_extfs_ops->which = extfs_which; + vfs_extfs_ops->open = extfs_open; + vfs_extfs_ops->close = extfs_close; + vfs_extfs_ops->read = extfs_read; + vfs_extfs_ops->write = extfs_write; + vfs_extfs_ops->opendir = extfs_opendir; + vfs_extfs_ops->readdir = extfs_readdir; + vfs_extfs_ops->closedir = extfs_closedir; + vfs_extfs_ops->stat = extfs_stat; + vfs_extfs_ops->lstat = extfs_lstat; + vfs_extfs_ops->fstat = extfs_fstat; + vfs_extfs_ops->chmod = extfs_chmod; + vfs_extfs_ops->chown = extfs_chown; + vfs_extfs_ops->readlink = extfs_readlink; + vfs_extfs_ops->unlink = extfs_unlink; + vfs_extfs_ops->chdir = extfs_chdir; + vfs_extfs_ops->ferrno = extfs_errno; + vfs_extfs_ops->lseek = extfs_lseek; + vfs_extfs_ops->getid = extfs_getid; + vfs_extfs_ops->nothingisopen = extfs_nothingisopen; + vfs_extfs_ops->free = extfs_free; + vfs_extfs_ops->getlocalcopy = extfs_getlocalcopy; + vfs_extfs_ops->ungetlocalcopy = extfs_ungetlocalcopy; + vfs_extfs_ops->mkdir = extfs_mkdir; + vfs_extfs_ops->rmdir = extfs_rmdir; + vfs_extfs_ops->setctl = extfs_setctl; + vfs_register_class (vfs_extfs_ops); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c index b7f0f049d..353f67cc3 100644 --- a/src/vfs/fish/fish.c +++ b/src/vfs/fish/fish.c @@ -155,7 +155,8 @@ typedef struct static char reply_str[80]; -static struct vfs_class vfs_fish_ops; +static struct vfs_s_subclass fish_subclass; +static struct vfs_class *vfs_fish_ops = (struct vfs_class *) &fish_subclass; /* --------------------------------------------------------------------------------------------- */ /*** file scope functions ************************************************************************/ @@ -343,7 +344,7 @@ fish_send_command (struct vfs_class *me, struct vfs_s_super *super, int flags, c va_start (ap, vars); r = fish_command_va (me, super, WAIT_REPLY, scr, vars, ap); va_end (ap); - vfs_stamp_create (&vfs_fish_ops, super); + vfs_stamp_create (vfs_fish_ops, super); if (r != COMPLETE) ERRNOR (E_REMOTE, -1); @@ -1700,7 +1701,7 @@ fish_fill_names (struct vfs_class *me, fill_names_f func) } name = - g_strconcat (vfs_fish_ops.prefix, VFS_PATH_URL_DELIMITER, + g_strconcat (vfs_fish_ops->prefix, VFS_PATH_URL_DELIMITER, super->path_element->user, "@", super->path_element->host, flags, PATH_SEP_STR, super->path_element->path, (char *) NULL); func (name); @@ -1728,8 +1729,6 @@ fish_open (const vfs_path_t * vpath, int flags, mode_t mode) void init_fish (void) { - static struct vfs_s_subclass fish_subclass; - tcp_init (); fish_subclass.flags = VFS_S_REMOTE | VFS_S_USETMP; @@ -1744,25 +1743,25 @@ init_fish (void) fish_subclass.linear_read = fish_linear_read; fish_subclass.linear_close = fish_linear_close; - vfs_s_init_class (&vfs_fish_ops, &fish_subclass); - vfs_fish_ops.name = "fish"; - vfs_fish_ops.prefix = "sh"; - vfs_fish_ops.fill_names = fish_fill_names; - vfs_fish_ops.stat = fish_stat; - vfs_fish_ops.lstat = fish_lstat; - vfs_fish_ops.fstat = fish_fstat; - vfs_fish_ops.chmod = fish_chmod; - vfs_fish_ops.chown = fish_chown; - vfs_fish_ops.utime = fish_utime; - vfs_fish_ops.open = fish_open; - vfs_fish_ops.symlink = fish_symlink; - vfs_fish_ops.link = fish_link; - vfs_fish_ops.unlink = fish_unlink; - vfs_fish_ops.rename = fish_rename; - vfs_fish_ops.mkdir = fish_mkdir; - vfs_fish_ops.rmdir = fish_rmdir; - vfs_fish_ops.ctl = fish_ctl; - vfs_register_class (&vfs_fish_ops); + vfs_s_init_class (&fish_subclass); + vfs_fish_ops->name = "fish"; + vfs_fish_ops->prefix = "sh"; + vfs_fish_ops->fill_names = fish_fill_names; + vfs_fish_ops->stat = fish_stat; + vfs_fish_ops->lstat = fish_lstat; + vfs_fish_ops->fstat = fish_fstat; + vfs_fish_ops->chmod = fish_chmod; + vfs_fish_ops->chown = fish_chown; + vfs_fish_ops->utime = fish_utime; + vfs_fish_ops->open = fish_open; + vfs_fish_ops->symlink = fish_symlink; + vfs_fish_ops->link = fish_link; + vfs_fish_ops->unlink = fish_unlink; + vfs_fish_ops->rename = fish_rename; + vfs_fish_ops->mkdir = fish_mkdir; + vfs_fish_ops->rmdir = fish_rmdir; + vfs_fish_ops->ctl = fish_ctl; + vfs_register_class (vfs_fish_ops); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c index 7f5926471..2350cbb75 100644 --- a/src/vfs/ftpfs/ftpfs.c +++ b/src/vfs/ftpfs/ftpfs.c @@ -237,7 +237,8 @@ static struct linklist *connections_list; static char reply_str[80]; -static struct vfs_class vfs_ftpfs_ops; +static struct vfs_s_subclass ftpfs_subclass; +static struct vfs_class *vfs_ftpfs_ops = (struct vfs_class *) &ftpfs_subclass; static GSList *no_proxy; @@ -2024,7 +2025,7 @@ ftpfs_send_command (const vfs_path_t * vpath, const char *cmd, int flags) p = ftpfs_translate_path (path_element->class, super, rpath); r = ftpfs_command (path_element->class, super, WAIT_REPLY, cmd, p); g_free (p); - vfs_stamp_create (&vfs_ftpfs_ops, super); + vfs_stamp_create (vfs_ftpfs_ops, super); if (flags & OPT_IGNORE_ERROR) r = COMPLETE; if (r != COMPLETE) @@ -2639,8 +2640,6 @@ ftpfs_init_passwd (void) void init_ftpfs (void) { - static struct vfs_s_subclass ftpfs_subclass; - tcp_init (); ftpfs_subclass.flags = VFS_S_REMOTE | VFS_S_USETMP; @@ -2656,23 +2655,23 @@ init_ftpfs (void) ftpfs_subclass.linear_read = ftpfs_linear_read; ftpfs_subclass.linear_close = ftpfs_linear_close; - vfs_s_init_class (&vfs_ftpfs_ops, &ftpfs_subclass); - vfs_ftpfs_ops.name = "ftpfs"; - vfs_ftpfs_ops.flags = VFSF_NOLINKS; - vfs_ftpfs_ops.prefix = "ftp"; - vfs_ftpfs_ops.done = &ftpfs_done; - vfs_ftpfs_ops.fill_names = ftpfs_fill_names; - vfs_ftpfs_ops.stat = ftpfs_stat; - vfs_ftpfs_ops.lstat = ftpfs_lstat; - vfs_ftpfs_ops.fstat = ftpfs_fstat; - vfs_ftpfs_ops.chmod = ftpfs_chmod; - vfs_ftpfs_ops.chown = ftpfs_chown; - vfs_ftpfs_ops.unlink = ftpfs_unlink; - vfs_ftpfs_ops.rename = ftpfs_rename; - vfs_ftpfs_ops.mkdir = ftpfs_mkdir; - vfs_ftpfs_ops.rmdir = ftpfs_rmdir; - vfs_ftpfs_ops.ctl = ftpfs_ctl; - vfs_register_class (&vfs_ftpfs_ops); + vfs_s_init_class (&ftpfs_subclass); + vfs_ftpfs_ops->name = "ftpfs"; + vfs_ftpfs_ops->flags = VFSF_NOLINKS; + vfs_ftpfs_ops->prefix = "ftp"; + vfs_ftpfs_ops->done = &ftpfs_done; + vfs_ftpfs_ops->fill_names = ftpfs_fill_names; + vfs_ftpfs_ops->stat = ftpfs_stat; + vfs_ftpfs_ops->lstat = ftpfs_lstat; + vfs_ftpfs_ops->fstat = ftpfs_fstat; + vfs_ftpfs_ops->chmod = ftpfs_chmod; + vfs_ftpfs_ops->chown = ftpfs_chown; + vfs_ftpfs_ops->unlink = ftpfs_unlink; + vfs_ftpfs_ops->rename = ftpfs_rename; + vfs_ftpfs_ops->mkdir = ftpfs_mkdir; + vfs_ftpfs_ops->rmdir = ftpfs_rmdir; + vfs_ftpfs_ops->ctl = ftpfs_ctl; + vfs_register_class (vfs_ftpfs_ops); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/sfs/sfs.c b/src/vfs/sfs/sfs.c index 57d3ad52b..73d1d2083 100644 --- a/src/vfs/sfs/sfs.c +++ b/src/vfs/sfs/sfs.c @@ -52,6 +52,7 @@ #include "lib/vfs/vfs.h" #include "lib/vfs/utilvfs.h" +#include "lib/vfs/xdirentry.h" #include "src/vfs/local/local.h" #include "lib/vfs/gc.h" /* vfs_stamp_create */ @@ -100,7 +101,9 @@ typedef struct cachedfile /*** file scope variables ************************************************************************/ static GSList *head; -static struct vfs_class vfs_sfs_ops; + +static struct vfs_s_subclass sfs_subclass; +static struct vfs_class *vfs_sfs_ops = (struct vfs_class *) &sfs_subclass; static int sfs_no = 0; static char *sfs_prefix[MAXFS]; @@ -233,7 +236,7 @@ sfs_redirect (const vfs_path_t * vpath) if (cur != NULL) { cf = (cachedfile *) cur->data; - vfs_stamp (&vfs_sfs_ops, cf); + vfs_stamp (vfs_sfs_ops, cf); return cf->cache; } @@ -252,7 +255,7 @@ sfs_redirect (const vfs_path_t * vpath) head = g_slist_prepend (head, cf); vfs_path_free (cache_vpath); - vfs_stamp_create (&vfs_sfs_ops, (cachedfile *) head->data); + vfs_stamp_create (vfs_sfs_ops, (cachedfile *) head->data); return cf->cache; } @@ -547,29 +550,32 @@ sfs_which (struct vfs_class *me, const char *path) void init_sfs (void) { - vfs_sfs_ops.name = "sfs"; - vfs_sfs_ops.init = sfs_init; - vfs_sfs_ops.done = sfs_done; - vfs_sfs_ops.fill_names = sfs_fill_names; - vfs_sfs_ops.which = sfs_which; - vfs_sfs_ops.open = sfs_open; - vfs_sfs_ops.close = local_close; - vfs_sfs_ops.read = local_read; - vfs_sfs_ops.stat = sfs_stat; - vfs_sfs_ops.lstat = sfs_lstat; - vfs_sfs_ops.fstat = local_fstat; - vfs_sfs_ops.chmod = sfs_chmod; - vfs_sfs_ops.chown = sfs_chown; - vfs_sfs_ops.utime = sfs_utime; - vfs_sfs_ops.readlink = sfs_readlink; - vfs_sfs_ops.ferrno = local_errno; - vfs_sfs_ops.lseek = local_lseek; - vfs_sfs_ops.getid = sfs_getid; - vfs_sfs_ops.nothingisopen = sfs_nothingisopen; - vfs_sfs_ops.free = sfs_free; - vfs_sfs_ops.getlocalcopy = sfs_getlocalcopy; - vfs_sfs_ops.ungetlocalcopy = sfs_ungetlocalcopy; - vfs_register_class (&vfs_sfs_ops); + memset (&sfs_subclass, 0, sizeof (sfs_subclass)); + vfs_s_init_class (&sfs_subclass); + + vfs_sfs_ops->name = "sfs"; + vfs_sfs_ops->init = sfs_init; + vfs_sfs_ops->done = sfs_done; + vfs_sfs_ops->fill_names = sfs_fill_names; + vfs_sfs_ops->which = sfs_which; + vfs_sfs_ops->open = sfs_open; + vfs_sfs_ops->close = local_close; + vfs_sfs_ops->read = local_read; + vfs_sfs_ops->stat = sfs_stat; + vfs_sfs_ops->lstat = sfs_lstat; + vfs_sfs_ops->fstat = local_fstat; + vfs_sfs_ops->chmod = sfs_chmod; + vfs_sfs_ops->chown = sfs_chown; + vfs_sfs_ops->utime = sfs_utime; + vfs_sfs_ops->readlink = sfs_readlink; + vfs_sfs_ops->ferrno = local_errno; + vfs_sfs_ops->lseek = local_lseek; + vfs_sfs_ops->getid = sfs_getid; + vfs_sfs_ops->nothingisopen = sfs_nothingisopen; + vfs_sfs_ops->free = sfs_free; + vfs_sfs_ops->getlocalcopy = sfs_getlocalcopy; + vfs_sfs_ops->ungetlocalcopy = sfs_ungetlocalcopy; + vfs_register_class (vfs_sfs_ops); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/sftpfs/file.c b/src/vfs/sftpfs/file.c index 76c64d077..ba96b7eb7 100644 --- a/src/vfs/sftpfs/file.c +++ b/src/vfs/sftpfs/file.c @@ -119,7 +119,7 @@ sftpfs_open_file (vfs_file_handler_t * file_handler, int flags, mode_t mode, GEr (void) mode; mc_return_val_if_error (mcerror, FALSE); - name = vfs_s_fullpath (&sftpfs_class, file_handler->ino); + name = vfs_s_fullpath (sftpfs_class, file_handler->ino); if (name == NULL) return FALSE; diff --git a/src/vfs/sftpfs/init.c b/src/vfs/sftpfs/init.c index af7d97f9d..50af6946f 100644 --- a/src/vfs/sftpfs/init.c +++ b/src/vfs/sftpfs/init.c @@ -34,6 +34,9 @@ /*** global variables ****************************************************************************/ +struct vfs_s_subclass sftpfs_subclass; +struct vfs_class *sftpfs_class = (struct vfs_class *) &sftpfs_subclass; + /*** file scope macro definitions ****************************************************************/ /*** file scope type declarations ****************************************************************/ @@ -55,15 +58,10 @@ init_sftpfs (void) { tcp_init (); - sftpfs_init_class (); sftpfs_init_subclass (); - - vfs_s_init_class (&sftpfs_class, &sftpfs_subclass); - - sftpfs_init_class_callbacks (); - sftpfs_init_subclass_callbacks (); - - vfs_register_class (&sftpfs_class); + vfs_s_init_class (&sftpfs_subclass); + sftpfs_init_class (); + vfs_register_class (sftpfs_class); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/sftpfs/internal.h b/src/vfs/sftpfs/internal.h index 2cce73772..6fd350aeb 100644 --- a/src/vfs/sftpfs/internal.h +++ b/src/vfs/sftpfs/internal.h @@ -54,15 +54,13 @@ typedef struct /*** global variables defined in .c file *********************************************************/ extern GString *sftpfs_filename_buffer; -extern struct vfs_class sftpfs_class; extern struct vfs_s_subclass sftpfs_subclass; +extern struct vfs_class *sftpfs_class; /*** declarations of public functions ************************************************************/ void sftpfs_init_class (void); void sftpfs_init_subclass (void); -void sftpfs_init_class_callbacks (void); -void sftpfs_init_subclass_callbacks (void); void sftpfs_init_config_variables_patterns (void); void sftpfs_deinit_config_variables_patterns (void); diff --git a/src/vfs/sftpfs/vfs_class.c b/src/vfs/sftpfs/vfs_class.c index a75d5b453..6a1a56547 100644 --- a/src/vfs/sftpfs/vfs_class.c +++ b/src/vfs/sftpfs/vfs_class.c @@ -36,8 +36,6 @@ /*** global variables ****************************************************************************/ -struct vfs_class sftpfs_class; - /*** file scope macro definitions ****************************************************************/ /*** file scope type declarations ****************************************************************/ @@ -495,7 +493,7 @@ sftpfs_cb_close (void *data) super->fd_usage--; if (super->fd_usage == 0) - vfs_stamp_create (&sftpfs_class, super); + vfs_stamp_create (sftpfs_class, super); rc = sftpfs_close_file (file_handler, &mcerror); mc_error_message (&mcerror, NULL); @@ -503,7 +501,7 @@ sftpfs_cb_close (void *data) if (file_handler->handle != -1) close (file_handler->handle); - vfs_s_free_inode (&sftpfs_class, file_handler->ino); + vfs_s_free_inode (sftpfs_class, file_handler->ino); g_free (file_handler); return rc; @@ -684,50 +682,40 @@ sftpfs_cb_fill_names (struct vfs_class *me, fill_names_f func) void sftpfs_init_class (void) { - memset (&sftpfs_class, 0, sizeof (sftpfs_class)); - sftpfs_class.name = "sftpfs"; - sftpfs_class.prefix = "sftp"; - sftpfs_class.flags = VFSF_NOLINKS; -} - -/* --------------------------------------------------------------------------------------------- */ -/** - * Initialization of VFS class callbacks. - */ - -void -sftpfs_init_class_callbacks (void) -{ - sftpfs_class.init = sftpfs_cb_init; - sftpfs_class.done = sftpfs_cb_done; - - sftpfs_class.fill_names = sftpfs_cb_fill_names; - - sftpfs_class.opendir = sftpfs_cb_opendir; - sftpfs_class.readdir = sftpfs_cb_readdir; - sftpfs_class.closedir = sftpfs_cb_closedir; - sftpfs_class.mkdir = sftpfs_cb_mkdir; - sftpfs_class.rmdir = sftpfs_cb_rmdir; - - sftpfs_class.stat = sftpfs_cb_stat; - sftpfs_class.lstat = sftpfs_cb_lstat; - sftpfs_class.fstat = sftpfs_cb_fstat; - sftpfs_class.readlink = sftpfs_cb_readlink; - sftpfs_class.symlink = sftpfs_cb_symlink; - sftpfs_class.link = sftpfs_cb_link; - sftpfs_class.utime = sftpfs_cb_utime; - sftpfs_class.mknod = sftpfs_cb_mknod; - sftpfs_class.chown = sftpfs_cb_chown; - sftpfs_class.chmod = sftpfs_cb_chmod; - - sftpfs_class.open = sftpfs_cb_open; - sftpfs_class.read = sftpfs_cb_read; - sftpfs_class.write = sftpfs_cb_write; - sftpfs_class.close = sftpfs_cb_close; - sftpfs_class.lseek = sftpfs_cb_lseek; - sftpfs_class.unlink = sftpfs_cb_unlink; - sftpfs_class.rename = sftpfs_cb_rename; - sftpfs_class.ferrno = sftpfs_cb_errno; + sftpfs_class->name = "sftpfs"; + sftpfs_class->prefix = "sftp"; + sftpfs_class->flags = VFSF_NOLINKS; + + sftpfs_class->init = sftpfs_cb_init; + sftpfs_class->done = sftpfs_cb_done; + + sftpfs_class->fill_names = sftpfs_cb_fill_names; + + sftpfs_class->opendir = sftpfs_cb_opendir; + sftpfs_class->readdir = sftpfs_cb_readdir; + sftpfs_class->closedir = sftpfs_cb_closedir; + sftpfs_class->mkdir = sftpfs_cb_mkdir; + sftpfs_class->rmdir = sftpfs_cb_rmdir; + + sftpfs_class->stat = sftpfs_cb_stat; + sftpfs_class->lstat = sftpfs_cb_lstat; + sftpfs_class->fstat = sftpfs_cb_fstat; + sftpfs_class->readlink = sftpfs_cb_readlink; + sftpfs_class->symlink = sftpfs_cb_symlink; + sftpfs_class->link = sftpfs_cb_link; + sftpfs_class->utime = sftpfs_cb_utime; + sftpfs_class->mknod = sftpfs_cb_mknod; + sftpfs_class->chown = sftpfs_cb_chown; + sftpfs_class->chmod = sftpfs_cb_chmod; + + sftpfs_class->open = sftpfs_cb_open; + sftpfs_class->read = sftpfs_cb_read; + sftpfs_class->write = sftpfs_cb_write; + sftpfs_class->close = sftpfs_cb_close; + sftpfs_class->lseek = sftpfs_cb_lseek; + sftpfs_class->unlink = sftpfs_cb_unlink; + sftpfs_class->rename = sftpfs_cb_rename; + sftpfs_class->ferrno = sftpfs_cb_errno; } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/sftpfs/vfs_subclass.c b/src/vfs/sftpfs/vfs_subclass.c index 5cc5bbcca..8373e2ee5 100644 --- a/src/vfs/sftpfs/vfs_subclass.c +++ b/src/vfs/sftpfs/vfs_subclass.c @@ -37,8 +37,6 @@ /*** global variables ****************************************************************************/ -struct vfs_s_subclass sftpfs_subclass; - /*** file scope macro definitions ****************************************************************/ /*** file scope type declarations ****************************************************************/ @@ -186,16 +184,7 @@ sftpfs_init_subclass (void) { memset (&sftpfs_subclass, 0, sizeof (sftpfs_subclass)); sftpfs_subclass.flags = VFS_S_REMOTE; -} -/* --------------------------------------------------------------------------------------------- */ -/** - * Initialization of VFS subclass callbacks. - */ - -void -sftpfs_init_subclass_callbacks (void) -{ sftpfs_subclass.archive_same = sftpfs_cb_is_equal_connection; sftpfs_subclass.open_archive = sftpfs_cb_open_connection; sftpfs_subclass.free_archive = sftpfs_cb_close_connection; diff --git a/src/vfs/tar/tar.c b/src/vfs/tar/tar.c index 95f12e731..5811f0a9e 100644 --- a/src/vfs/tar/tar.c +++ b/src/vfs/tar/tar.c @@ -222,7 +222,8 @@ typedef struct /*** file scope variables ************************************************************************/ -static struct vfs_class vfs_tarfs_ops; +static struct vfs_s_subclass tarfs_subclass; +static struct vfs_class *vfs_tarfs_ops = (struct vfs_class *) &tarfs_subclass; /* As we open one archive at a time, it is safe to have this static */ static off_t current_tar_position = 0; @@ -878,12 +879,12 @@ tar_super_same (const vfs_path_element_t * vpath_element, struct vfs_s_super *pa if (((tar_super_data_t *) parc->data)->st.st_mtime < archive_stat->st_mtime) { /* Yes, reload! */ - (*vfs_tarfs_ops.free) ((vfsid) parc); - vfs_rmstamp (&vfs_tarfs_ops, (vfsid) parc); + vfs_tarfs_ops->free ((vfsid) parc); + vfs_rmstamp (vfs_tarfs_ops, (vfsid) parc); return 2; } /* Hasn't been modified, give it a new timeout */ - vfs_stamp (&vfs_tarfs_ops, (vfsid) parc); + vfs_stamp (vfs_tarfs_ops, (vfsid) parc); return 1; } @@ -930,8 +931,6 @@ tar_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t mo void init_tarfs (void) { - static struct vfs_s_subclass tarfs_subclass; - tarfs_subclass.flags = VFS_S_READONLY; /* FIXME: tarfs used own temp files */ tarfs_subclass.archive_check = tar_super_check; tarfs_subclass.archive_same = tar_super_same; @@ -939,12 +938,12 @@ init_tarfs (void) tarfs_subclass.free_archive = tar_free_archive; tarfs_subclass.fh_open = tar_fh_open; - vfs_s_init_class (&vfs_tarfs_ops, &tarfs_subclass); - vfs_tarfs_ops.name = "tarfs"; - vfs_tarfs_ops.prefix = "utar"; - vfs_tarfs_ops.read = tar_read; - vfs_tarfs_ops.setctl = NULL; - vfs_register_class (&vfs_tarfs_ops); + vfs_s_init_class (&tarfs_subclass); + vfs_tarfs_ops->name = "tarfs"; + vfs_tarfs_ops->prefix = "utar"; + vfs_tarfs_ops->read = tar_read; + vfs_tarfs_ops->setctl = NULL; + vfs_register_class (vfs_tarfs_ops); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/undelfs/undelfs.c b/src/vfs/undelfs/undelfs.c index 5b06009c1..7ad9480bd 100644 --- a/src/vfs/undelfs/undelfs.c +++ b/src/vfs/undelfs/undelfs.c @@ -64,6 +64,7 @@ #include "lib/util.h" #include "lib/widget.h" /* message() */ +#include "lib/vfs/xdirentry.h" #include "lib/vfs/utilvfs.h" #include "lib/vfs/vfs.h" @@ -129,8 +130,11 @@ static char *block_buf; static const char *undelfserr = N_("undelfs: error"); static int readdir_ptr; static int undelfs_usage; -static struct vfs_class vfs_undelfs_ops; +static struct vfs_s_subclass undelfs_subclass; +static struct vfs_class *vfs_undelfs_ops = (struct vfs_class *) &undelfs_subclass; + +/* --------------------------------------------------------------------------------------------- */ /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ @@ -820,24 +824,27 @@ com_err (const char *whoami, long err_code, const char *fmt, ...) void init_undelfs (void) { - vfs_undelfs_ops.name = "undelfs"; - vfs_undelfs_ops.prefix = "undel"; - vfs_undelfs_ops.init = undelfs_init; - vfs_undelfs_ops.open = undelfs_open; - vfs_undelfs_ops.close = undelfs_close; - vfs_undelfs_ops.read = undelfs_read; - vfs_undelfs_ops.opendir = undelfs_opendir; - vfs_undelfs_ops.readdir = undelfs_readdir; - vfs_undelfs_ops.closedir = undelfs_closedir; - vfs_undelfs_ops.stat = undelfs_stat; - vfs_undelfs_ops.lstat = undelfs_lstat; - vfs_undelfs_ops.fstat = undelfs_fstat; - vfs_undelfs_ops.chdir = undelfs_chdir; - vfs_undelfs_ops.lseek = undelfs_lseek; - vfs_undelfs_ops.getid = undelfs_getid; - vfs_undelfs_ops.nothingisopen = undelfs_nothingisopen; - vfs_undelfs_ops.free = undelfs_free; - vfs_register_class (&vfs_undelfs_ops); + memset (&undelfs_subclass, 0, sizeof (undelfs_subclass)); + vfs_s_init_class (&undelfs_subclass); + + vfs_undelfs_ops->name = "undelfs"; + vfs_undelfs_ops->prefix = "undel"; + vfs_undelfs_ops->init = undelfs_init; + vfs_undelfs_ops->open = undelfs_open; + vfs_undelfs_ops->close = undelfs_close; + vfs_undelfs_ops->read = undelfs_read; + vfs_undelfs_ops->opendir = undelfs_opendir; + vfs_undelfs_ops->readdir = undelfs_readdir; + vfs_undelfs_ops->closedir = undelfs_closedir; + vfs_undelfs_ops->stat = undelfs_stat; + vfs_undelfs_ops->lstat = undelfs_lstat; + vfs_undelfs_ops->fstat = undelfs_fstat; + vfs_undelfs_ops->chdir = undelfs_chdir; + vfs_undelfs_ops->lseek = undelfs_lseek; + vfs_undelfs_ops->getid = undelfs_getid; + vfs_undelfs_ops->nothingisopen = undelfs_nothingisopen; + vfs_undelfs_ops->free = undelfs_free; + vfs_register_class (vfs_undelfs_ops); } /* --------------------------------------------------------------------------------------------- */ From ab033ad31896fe3773931a9b4ef7ade79fe36733 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 17 Aug 2016 13:54:08 +0300 Subject: [PATCH 04/25] VFS: make VFS-specific super class as derived one from vfs_s_super. Signed-off-by: Andrew Borodin --- lib/vfs/direntry.c | 8 +++-- lib/vfs/xdirentry.h | 5 +-- src/vfs/cpio/cpio.c | 64 +++++++++++++++++++--------------- src/vfs/fish/fish.c | 21 ++++++++--- src/vfs/ftpfs/ftpfs.c | 39 +++++++++++++-------- src/vfs/sftpfs/config_parser.c | 7 ++-- src/vfs/sftpfs/connection.c | 27 ++++---------- src/vfs/sftpfs/dir.c | 6 ++-- src/vfs/sftpfs/file.c | 8 ++--- src/vfs/sftpfs/internal.c | 2 +- src/vfs/sftpfs/internal.h | 4 +++ src/vfs/sftpfs/vfs_subclass.c | 33 +++++++++++------- src/vfs/tar/tar.c | 46 +++++++++++++++--------- 13 files changed, 156 insertions(+), 114 deletions(-) diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 0cc0f4ee9..86af051b8 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -826,7 +826,7 @@ vfs_s_nothingisopen (vfsid id) static void vfs_s_free (vfsid id) { - vfs_s_free_super (((struct vfs_s_super *) id)->me, (struct vfs_s_super *) id); + vfs_s_free_super (VFS_SUPER (id)->me, VFS_SUPER (id)); } /* --------------------------------------------------------------------------------------------- */ @@ -1094,7 +1094,7 @@ vfs_get_super_by_vpath (const vfs_path_t * vpath) { int i; - super = (struct vfs_s_super *) iter->data; + super = VFS_SUPER (iter->data); /* 0 == other, 1 == same, return it, 2 == other but stop scanning */ i = subclass->archive_same (path_element, super, vpath_archive, cookie); @@ -1145,9 +1145,11 @@ vfs_s_get_path (const vfs_path_t * vpath, struct vfs_s_super **archive, int flag return NULL; } - super = vfs_s_new_super (path_element->class); subclass = VFS_SUBCLASS (path_element); + super = subclass->new_archive != NULL ? + subclass->new_archive (path_element->class) : vfs_s_new_super (path_element->class); + if (subclass->open_archive != NULL) { vfs_path_t *vpath_archive; diff --git a/lib/vfs/xdirentry.h b/lib/vfs/xdirentry.h index 6eca8526f..d3a17d30a 100644 --- a/lib/vfs/xdirentry.h +++ b/lib/vfs/xdirentry.h @@ -34,6 +34,8 @@ #define ERRNOR(a, b) do { me->verrno = a; return b; } while (0) +#define VFS_SUPER(a) ((struct vfs_s_super *) (a)) + #define MEDATA ((struct vfs_s_subclass *) me) #define VFS_SUBCLASS(a) ((struct vfs_s_subclass *) a->class) @@ -73,8 +75,6 @@ struct vfs_s_super #ifdef ENABLE_VFS_NET vfs_path_element_t *path_element; #endif /* ENABLE_VFS_NET */ - - void *data; /* This is for filesystem-specific use */ }; /* @@ -137,6 +137,7 @@ struct vfs_s_subclass void *(*archive_check) (const vfs_path_t * vpath); /* optional */ int (*archive_same) (const vfs_path_element_t * vpath_element, struct vfs_s_super * psup, const vfs_path_t * vpath, void *cookie); + struct vfs_s_super *(*new_archive) (struct vfs_class * me); int (*open_archive) (struct vfs_s_super * psup, const vfs_path_t * vpath, const vfs_path_element_t * vpath_element); void (*free_archive) (struct vfs_class * me, struct vfs_s_super * psup); diff --git a/src/vfs/cpio/cpio.c b/src/vfs/cpio/cpio.c index eb3f299f4..21fb5d1da 100644 --- a/src/vfs/cpio/cpio.c +++ b/src/vfs/cpio/cpio.c @@ -52,23 +52,19 @@ /*** file scope macro definitions ****************************************************************/ +#define SUP(super) ((cpio_super_data_t *) (super)) + #define CPIO_POS(super) cpio_position /* If some time reentrancy should be needed change it to */ /* #define CPIO_POS(super) (super)->u.arch.fd */ -#define CPIO_SEEK_SET(super, where) \ - mc_lseek (((cpio_super_data_t *)(super)->data)->fd, \ - CPIO_POS(super) = (where), SEEK_SET) -#define CPIO_SEEK_CUR(super, where) \ - mc_lseek (((cpio_super_data_t *)(super)->data)->fd, \ - CPIO_POS(super) += (where), SEEK_SET) +#define CPIO_SEEK_SET(super, where) mc_lseek (SUP(super)->fd, CPIO_POS(super) = (where), SEEK_SET) +#define CPIO_SEEK_CUR(super, where) mc_lseek (SUP(super)->fd, CPIO_POS(super) += (where), SEEK_SET) #define MAGIC_LENGTH (6) /* How many bytes we have to read ahead */ #define SEEKBACK CPIO_SEEK_CUR(super, ptr - top) -#define RETURN(x) return (((cpio_super_data_t *)super->data)->type = (x)) -#define TYPEIS(x) \ - ((((cpio_super_data_t *)super->data)->type == CPIO_UNKNOWN) || \ - (((cpio_super_data_t *)super->data)->type == (x))) +#define RETURN(x) return (SUP(super)->type = (x)) +#define TYPEIS(x) ((SUP(super)->type == CPIO_UNKNOWN) || (SUP(super)->type == (x))) #define HEAD_LENGTH (26) @@ -135,6 +131,8 @@ typedef struct typedef struct { + struct vfs_s_super base; /* base class */ + int fd; struct stat st; int type; /* Type of the archive */ @@ -148,6 +146,7 @@ static struct vfs_class *vfs_cpiofs_ops = (struct vfs_class *) &cpio_subclass; static off_t cpio_position; +/* --------------------------------------------------------------------------------------------- */ /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ @@ -173,7 +172,7 @@ cpio_defer_find (const void *a, const void *b) static ssize_t cpio_skip_padding (struct vfs_s_super *super) { - switch (((cpio_super_data_t *) super->data)->type) + switch (SUP (super)->type) { case CPIO_BIN: case CPIO_BINRE: @@ -191,22 +190,33 @@ cpio_skip_padding (struct vfs_s_super *super) /* --------------------------------------------------------------------------------------------- */ +static struct vfs_s_super * +cpio_new_archive (struct vfs_class *me) +{ + cpio_super_data_t *arch; + + arch = g_new0 (cpio_super_data_t, 1); + arch->base.me = me; + arch->fd = -1; /* for now */ + arch->type = CPIO_UNKNOWN; + + return VFS_SUPER (arch); +} + +/* --------------------------------------------------------------------------------------------- */ + static void cpio_free_archive (struct vfs_class *me, struct vfs_s_super *super) { - cpio_super_data_t *arch = (cpio_super_data_t *) super->data; + cpio_super_data_t *arch = SUP (super); (void) me; - if (super->data == NULL) - return; - if (arch->fd != -1) mc_close (arch->fd); arch->fd = -1; g_slist_free_full (arch->deferred, g_free); arch->deferred = NULL; - MC_PTR_FREE (super->data); } /* --------------------------------------------------------------------------------------------- */ @@ -227,12 +237,8 @@ cpio_open_cpio_file (struct vfs_class *me, struct vfs_s_super *super, const vfs_ } super->name = g_strdup (vfs_path_as_str (vpath)); - super->data = g_new (cpio_super_data_t, 1); - arch = (cpio_super_data_t *) super->data; - arch->fd = -1; /* for now */ + arch = SUP (super); mc_stat (vpath, &arch->st); - arch->type = CPIO_UNKNOWN; - arch->deferred = NULL; type = get_compression_type (fd, super->name); if (type == COMPRESSION_NONE) @@ -303,7 +309,7 @@ cpio_read_head (struct vfs_class *me, struct vfs_s_super *super) static ssize_t cpio_find_head (struct vfs_class *me, struct vfs_s_super *super) { - cpio_super_data_t *arch = (cpio_super_data_t *) super->data; + cpio_super_data_t *arch = SUP (super); char buf[BUF_SMALL * 2]; ssize_t ptr = 0; ssize_t top; @@ -367,7 +373,7 @@ cpio_find_head (struct vfs_class *me, struct vfs_s_super *super) static int cpio_create_entry (struct vfs_class *me, struct vfs_s_super *super, struct stat *st, char *name) { - cpio_super_data_t *arch = (cpio_super_data_t *) super->data; + cpio_super_data_t *arch = SUP (super); struct vfs_s_inode *inode = NULL; struct vfs_s_inode *root = super->root; struct vfs_s_entry *entry = NULL; @@ -548,7 +554,7 @@ cpio_read_bin_head (struct vfs_class *me, struct vfs_s_super *super) short shorts[HEAD_LENGTH >> 1]; } u; - cpio_super_data_t *arch = (cpio_super_data_t *) super->data; + cpio_super_data_t *arch = SUP (super); ssize_t len; char *name; struct stat st; @@ -612,7 +618,7 @@ cpio_read_bin_head (struct vfs_class *me, struct vfs_s_super *super) static ssize_t cpio_read_oldc_head (struct vfs_class *me, struct vfs_s_super *super) { - cpio_super_data_t *arch = (cpio_super_data_t *) super->data; + cpio_super_data_t *arch = SUP (super); struct new_cpio_header hd; union { @@ -684,7 +690,7 @@ cpio_read_oldc_head (struct vfs_class *me, struct vfs_s_super *super) static ssize_t cpio_read_crc_head (struct vfs_class *me, struct vfs_s_super *super) { - cpio_super_data_t *arch = (cpio_super_data_t *) super->data; + cpio_super_data_t *arch = SUP (super); struct new_cpio_header hd; union { @@ -825,8 +831,7 @@ cpio_super_same (const vfs_path_element_t * vpath_element, struct vfs_s_super *p return 0; /* Has the cached archive been changed on the disk? */ - if (parc->data != NULL - && ((cpio_super_data_t *) parc->data)->st.st_mtime < archive_stat->st_mtime) + if (parc != NULL && SUP (parc)->st.st_mtime < archive_stat->st_mtime) { /* Yes, reload! */ vfs_cpiofs_ops->free ((vfsid) parc); @@ -844,7 +849,7 @@ static ssize_t cpio_read (void *fh, char *buffer, size_t count) { off_t begin = FH->ino->data_offset; - int fd = ((cpio_super_data_t *) FH_SUPER->data)->fd; + int fd = SUP (FH_SUPER)->fd; struct vfs_class *me = FH_SUPER->me; ssize_t res; @@ -885,6 +890,7 @@ init_cpiofs (void) cpio_subclass.flags = VFS_S_READONLY; /* FIXME: cpiofs used own temp files */ cpio_subclass.archive_check = cpio_super_check; cpio_subclass.archive_same = cpio_super_same; + cpio_subclass.new_archive = cpio_new_archive; cpio_subclass.open_archive = cpio_open_archive; cpio_subclass.free_archive = cpio_free_archive; cpio_subclass.fh_open = cpio_fh_open; diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c index 353f67cc3..ae87c9110 100644 --- a/src/vfs/fish/fish.c +++ b/src/vfs/fish/fish.c @@ -117,12 +117,14 @@ int fish_directory_timeout = 900; #define FISH_HAVE_DATE_MDYT 32 #define FISH_HAVE_TAIL 64 -#define SUP ((fish_super_data_t *) super->data) +#define SUP ((fish_super_data_t *) super) /*** file scope type declarations ****************************************************************/ typedef struct { + struct vfs_s_super base; /* base class */ + int sockr; int sockw; char *scr_ls; @@ -356,6 +358,19 @@ fish_send_command (struct vfs_class *me, struct vfs_s_super *super, int flags, c /* --------------------------------------------------------------------------------------------- */ +static struct vfs_s_super * +fish_new_archive (struct vfs_class *me) +{ + fish_super_data_t *arch; + + arch = g_new0 (fish_super_data_t, 1); + arch->base.me = me; + + return VFS_SUPER (arch); +} + +/* --------------------------------------------------------------------------------------------- */ + static void fish_free_archive (struct vfs_class *me, struct vfs_s_super *super) { @@ -383,8 +398,6 @@ fish_free_archive (struct vfs_class *me, struct vfs_s_super *super) g_free (SUP->scr_append); g_free (SUP->scr_info); g_free (SUP->scr_env); - g_free (SUP); - super->data = NULL; } /* --------------------------------------------------------------------------------------------- */ @@ -647,7 +660,6 @@ fish_open_archive (struct vfs_s_super *super, { (void) vpath; - super->data = g_new0 (fish_super_data_t, 1); super->path_element = vfs_path_element_clone (vpath_element); if (strncmp (vpath_element->vfs_prefix, "rsh", 3) == 0) @@ -1733,6 +1745,7 @@ init_fish (void) fish_subclass.flags = VFS_S_REMOTE | VFS_S_USETMP; fish_subclass.archive_same = fish_archive_same; + fish_subclass.new_archive = fish_new_archive; fish_subclass.open_archive = fish_open_archive; fish_subclass.free_archive = fish_free_archive; fish_subclass.fh_open = fish_fh_open; diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c index 2350cbb75..a1cb20cee 100644 --- a/src/vfs/ftpfs/ftpfs.c +++ b/src/vfs/ftpfs/ftpfs.c @@ -153,8 +153,8 @@ gboolean ftpfs_ignore_chattr_errors = TRUE; #define MAXHOSTNAMELEN 64 #endif -#define SUP ((ftp_super_data_t *) super->data) -#define FH_SOCK ((ftp_fh_data_t *) fh->data)->sock +#define SUP ((ftp_super_data_t *) super) +#define FH_SOCK ((ftp_fh_data_t *) fh)->sock #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff @@ -203,6 +203,8 @@ typedef enum typedef struct { + struct vfs_s_super base; /* base class */ + int sock; char *proxy; /* proxy server, NULL if no proxy */ @@ -559,6 +561,24 @@ ftpfs_command (struct vfs_class *me, struct vfs_s_super *super, int wait_reply, /* --------------------------------------------------------------------------------------------- */ +static struct vfs_s_super * +ftpfs_new_archive (struct vfs_class *me) +{ + ftp_super_data_t *arch; + + arch = g_new0 (ftp_super_data_t, 1); + arch->base.me = me; + arch->base.name = g_strdup (PATH_SEP_STR); + arch->sock = -1; + arch->use_passive_connection = ftpfs_use_passive_connections; + arch->strict = ftpfs_use_unix_list_options ? RFC_AUTODETECT : RFC_STRICT; + arch->isbinary = TYPE_UNKNOWN; + + return VFS_SUPER (arch); +} + +/* --------------------------------------------------------------------------------------------- */ + static void ftpfs_free_archive (struct vfs_class *me, struct vfs_s_super *super) { @@ -569,7 +589,6 @@ ftpfs_free_archive (struct vfs_class *me, struct vfs_s_super *super) close (SUP->sock); } g_free (SUP->current_dir); - MC_PTR_FREE (super->data); } /* --------------------------------------------------------------------------------------------- */ @@ -999,18 +1018,9 @@ ftpfs_open_archive (struct vfs_s_super *super, { (void) vpath; - super->data = g_new0 (ftp_super_data_t, 1); - super->path_element = ftpfs_correct_url_parameters (vpath_element); - SUP->proxy = NULL; if (ftpfs_check_proxy (super->path_element->host)) SUP->proxy = ftpfs_proxy_host; - SUP->use_passive_connection = ftpfs_use_passive_connections; - SUP->strict = ftpfs_use_unix_list_options ? RFC_AUTODETECT : RFC_STRICT; - SUP->isbinary = TYPE_UNKNOWN; - SUP->remote_is_amiga = 0; - SUP->ctl_connection_busy = 0; - super->name = g_strdup (PATH_SEP_STR); super->root = vfs_s_new_inode (vpath_element->class, super, ftpfs_default_stat (vpath_element->class)); @@ -2219,7 +2229,7 @@ ftpfs_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t * to local temporary file and stored to ftp server * by vfs_s_close later */ - if (((ftp_super_data_t *) (FH_SUPER->data))->ctl_connection_busy) + if (((ftp_super_data_t *) FH_SUPER)->ctl_connection_busy) { if (!fh->ino->localname) { @@ -2281,7 +2291,7 @@ ftpfs_fh_close (struct vfs_class *me, vfs_file_handler_t * fh) { if (fh->handle != -1 && !fh->ino->localname) { - ftp_super_data_t *ftp = (ftp_super_data_t *) fh->ino->super->data; + ftp_super_data_t *ftp = (ftp_super_data_t *) fh->ino->super; close (fh->handle); fh->handle = -1; @@ -2644,6 +2654,7 @@ init_ftpfs (void) ftpfs_subclass.flags = VFS_S_REMOTE | VFS_S_USETMP; ftpfs_subclass.archive_same = ftpfs_archive_same; + ftpfs_subclass.new_archive = ftpfs_new_archive; ftpfs_subclass.open_archive = ftpfs_open_archive; ftpfs_subclass.free_archive = ftpfs_free_archive; ftpfs_subclass.fh_open = ftpfs_fh_open; diff --git a/src/vfs/sftpfs/config_parser.c b/src/vfs/sftpfs/config_parser.c index ff2547165..638921ed5 100644 --- a/src/vfs/sftpfs/config_parser.c +++ b/src/vfs/sftpfs/config_parser.c @@ -354,19 +354,16 @@ sftpfs_get_config_entity (const vfs_path_element_t * vpath_element, GError ** mc void sftpfs_fill_connection_data_from_config (struct vfs_s_super *super, GError ** mcerror) { - sftpfs_super_data_t *super_data; + sftpfs_super_data_t *super_data = SUP; sftpfs_ssh_config_entity_t *config_entity; mc_return_if_error (mcerror); - super_data = (sftpfs_super_data_t *) super->data; - config_entity = sftpfs_get_config_entity (super->path_element, mcerror); if (config_entity == NULL) return; - super_data->config_auth_type = NONE; - super_data->config_auth_type |= (config_entity->pubkey_auth) ? PUBKEY : 0; + super_data->config_auth_type = (config_entity->pubkey_auth) ? PUBKEY : 0; super_data->config_auth_type |= (config_entity->identities_only) ? 0 : AGENT; super_data->config_auth_type |= (config_entity->password_auth) ? PASSWORD : 0; diff --git a/src/vfs/sftpfs/connection.c b/src/vfs/sftpfs/connection.c index 537159129..64210e578 100644 --- a/src/vfs/sftpfs/connection.c +++ b/src/vfs/sftpfs/connection.c @@ -167,11 +167,7 @@ static void sftpfs_recognize_auth_types (struct vfs_s_super *super) { char *userauthlist; - sftpfs_super_data_t *super_data; - - super_data = (sftpfs_super_data_t *) super->data; - - super_data->auth_type = NONE; + sftpfs_super_data_t *super_data = SUP; /* check what authentication methods are available */ /* userauthlist is internally managed by libssh2 and freed by libssh2_session_free() */ @@ -202,13 +198,12 @@ sftpfs_recognize_auth_types (struct vfs_s_super *super) static gboolean sftpfs_open_connection_ssh_agent (struct vfs_s_super *super, GError ** mcerror) { - sftpfs_super_data_t *super_data; + sftpfs_super_data_t *super_data = SUP; struct libssh2_agent_publickey *identity, *prev_identity = NULL; int rc; mc_return_val_if_error (mcerror, FALSE); - super_data = (sftpfs_super_data_t *) super->data; super_data->agent = NULL; if ((super_data->auth_type & AGENT) == 0) @@ -255,14 +250,12 @@ sftpfs_open_connection_ssh_agent (struct vfs_s_super *super, GError ** mcerror) static gboolean sftpfs_open_connection_ssh_key (struct vfs_s_super *super, GError ** mcerror) { - sftpfs_super_data_t *super_data; + sftpfs_super_data_t *super_data = SUP; char *p, *passwd; gboolean ret_value = FALSE; mc_return_val_if_error (mcerror, FALSE); - super_data = (sftpfs_super_data_t *) super->data; - if ((super_data->auth_type & PUBKEY) == 0) return FALSE; @@ -304,15 +297,13 @@ sftpfs_open_connection_ssh_key (struct vfs_s_super *super, GError ** mcerror) static gboolean sftpfs_open_connection_ssh_password (struct vfs_s_super *super, GError ** mcerror) { - sftpfs_super_data_t *super_data; + sftpfs_super_data_t *super_data = SUP; char *p, *passwd; gboolean ret_value = FALSE; int rc; mc_return_val_if_error (mcerror, FALSE); - super_data = (sftpfs_super_data_t *) super->data; - if ((super_data->auth_type & PASSWORD) == 0) return FALSE; @@ -365,12 +356,10 @@ int sftpfs_open_connection (struct vfs_s_super *super, GError ** mcerror) { int rc; - sftpfs_super_data_t *super_data; + sftpfs_super_data_t *super_data = SUP; mc_return_val_if_error (mcerror, -1); - super_data = (sftpfs_super_data_t *) super->data; - /* * The application code is responsible for creating the socket * and establishing the connection @@ -436,15 +425,11 @@ sftpfs_open_connection (struct vfs_s_super *super, GError ** mcerror) void sftpfs_close_connection (struct vfs_s_super *super, const char *shutdown_message, GError ** mcerror) { - sftpfs_super_data_t *super_data; + sftpfs_super_data_t *super_data = SUP; /* no mc_return_*_if_error() here because of abort open_connection handling too */ (void) mcerror; - super_data = (sftpfs_super_data_t *) super->data; - if (super_data == NULL) - return; - if (super_data->sftp_session != NULL) { libssh2_sftp_shutdown (super_data->sftp_session); diff --git a/src/vfs/sftpfs/dir.c b/src/vfs/sftpfs/dir.c index 367ab6725..50e57911f 100644 --- a/src/vfs/sftpfs/dir.c +++ b/src/vfs/sftpfs/dir.c @@ -78,7 +78,7 @@ sftpfs_opendir (const vfs_path_t * vpath, GError ** mcerror) if (vfs_s_get_path (vpath, &super, 0) == NULL) return NULL; - super_data = (sftpfs_super_data_t *) super->data; + super_data = SUP; while (TRUE) { @@ -194,7 +194,7 @@ sftpfs_mkdir (const vfs_path_t * vpath, mode_t mode, GError ** mcerror) if (super == NULL) return -1; - super_data = (sftpfs_super_data_t *) super->data; + super_data = SUP; if (super_data->sftp_session == NULL) return -1; @@ -244,7 +244,7 @@ sftpfs_rmdir (const vfs_path_t * vpath, GError ** mcerror) if (super == NULL) return -1; - super_data = (sftpfs_super_data_t *) super->data; + super_data = SUP; if (super_data->sftp_session == NULL) return -1; diff --git a/src/vfs/sftpfs/file.c b/src/vfs/sftpfs/file.c index ba96b7eb7..6001f3b37 100644 --- a/src/vfs/sftpfs/file.c +++ b/src/vfs/sftpfs/file.c @@ -123,7 +123,7 @@ sftpfs_open_file (vfs_file_handler_t * file_handler, int flags, mode_t mode, GEr if (name == NULL) return FALSE; - super_data = (sftpfs_super_data_t *) file_handler->ino->super->data; + super_data = (sftpfs_super_data_t *) file_handler->ino->super; file_handler_data = g_new0 (sftpfs_file_handler_data_t, 1); if ((flags & O_CREAT) != 0 || (flags & O_WRONLY) != 0) @@ -214,7 +214,7 @@ sftpfs_fstat (void *data, struct stat *buf, GError ** mcerror) vfs_file_handler_t *fh = (vfs_file_handler_t *) data; sftpfs_file_handler_data_t *sftpfs_fh = fh->data; struct vfs_s_super *super = fh->ino->super; - sftpfs_super_data_t *super_data = (sftpfs_super_data_t *) super->data; + sftpfs_super_data_t *super_data = SUP; mc_return_val_if_error (mcerror, -1); @@ -269,7 +269,7 @@ sftpfs_read_file (vfs_file_handler_t * file_handler, char *buffer, size_t count, } file_handler_data = file_handler->data; - super_data = (sftpfs_super_data_t *) file_handler->ino->super->data; + super_data = (sftpfs_super_data_t *) file_handler->ino->super; do { @@ -314,7 +314,7 @@ sftpfs_write_file (vfs_file_handler_t * file_handler, const char *buffer, size_t mc_return_val_if_error (mcerror, -1); file_handler_data = (sftpfs_file_handler_data_t *) file_handler->data; - super_data = (sftpfs_super_data_t *) file_handler->ino->super->data; + super_data = (sftpfs_super_data_t *) file_handler->ino->super; file_handler->pos = (off_t) libssh2_sftp_tell64 (file_handler_data->handle); diff --git a/src/vfs/sftpfs/internal.c b/src/vfs/sftpfs/internal.c index 0b03f1d51..2f95c13c8 100644 --- a/src/vfs/sftpfs/internal.c +++ b/src/vfs/sftpfs/internal.c @@ -117,7 +117,7 @@ sftpfs_op_init (sftpfs_super_data_t ** super_data, const vfs_path_element_t ** p if (super == NULL) return FALSE; - *super_data = (sftpfs_super_data_t *) super->data; + *super_data = SUP; if ((*super_data)->sftp_session == NULL) return FALSE; diff --git a/src/vfs/sftpfs/internal.h b/src/vfs/sftpfs/internal.h index 6fd350aeb..4846f5666 100644 --- a/src/vfs/sftpfs/internal.h +++ b/src/vfs/sftpfs/internal.h @@ -21,6 +21,8 @@ #define LIBSSH2_INVALID_SOCKET -1 #endif +#define SUP ((sftpfs_super_data_t *) super) + /*** enums ***************************************************************************************/ typedef enum @@ -35,6 +37,8 @@ typedef enum typedef struct { + struct vfs_s_super base; + sftpfs_auth_type_t auth_type; sftpfs_auth_type_t config_auth_type; diff --git a/src/vfs/sftpfs/vfs_subclass.c b/src/vfs/sftpfs/vfs_subclass.c index 8373e2ee5..3abddbcbe 100644 --- a/src/vfs/sftpfs/vfs_subclass.c +++ b/src/vfs/sftpfs/vfs_subclass.c @@ -65,7 +65,7 @@ sftpfs_cb_is_equal_connection (const vfs_path_element_t * vpath_element, struct (void) vpath; (void) cookie; - orig_connect_info = ((sftpfs_super_data_t *) super->data)->original_connection_info; + orig_connect_info = ((sftpfs_super_data_t *) super)->original_connection_info; result = ((g_strcmp0 (vpath_element->host, orig_connect_info->host) == 0) && (g_strcmp0 (vpath_element->user, orig_connect_info->user) == 0) @@ -74,6 +74,23 @@ sftpfs_cb_is_equal_connection (const vfs_path_element_t * vpath_element, struct return result; } +/* --------------------------------------------------------------------------------------------- */ + +static struct vfs_s_super * +sftpfs_cb_init_connection (struct vfs_class *me) +{ + sftpfs_super_data_t *arch; + + arch = g_new0 (sftpfs_super_data_t, 1); + arch->base.me = me; + arch->base.name = g_strdup (PATH_SEP_STR); + arch->auth_type = NONE; + arch->config_auth_type = NONE; + arch->socket_handle = LIBSSH2_INVALID_SOCKET; + + return VFS_SUPER (arch); +} + /* --------------------------------------------------------------------------------------------- */ /** * Callback for opening new connection. @@ -89,7 +106,7 @@ sftpfs_cb_open_connection (struct vfs_s_super *super, const vfs_path_t * vpath, const vfs_path_element_t * vpath_element) { GError *mcerror = NULL; - sftpfs_super_data_t *sftpfs_super_data; + sftpfs_super_data_t *sftpfs_super_data = SUP; int ret_value; (void) vpath; @@ -101,10 +118,7 @@ sftpfs_cb_open_connection (struct vfs_s_super *super, return -1; } - sftpfs_super_data = g_new0 (sftpfs_super_data_t, 1); - sftpfs_super_data->socket_handle = LIBSSH2_INVALID_SOCKET; sftpfs_super_data->original_connection_info = vfs_path_element_clone (vpath_element); - super->data = sftpfs_super_data; super->path_element = vfs_path_element_clone (vpath_element); sftpfs_fill_connection_data_from_config (super, &mcerror); @@ -114,7 +128,6 @@ sftpfs_cb_open_connection (struct vfs_s_super *super, return -1; } - super->name = g_strdup (PATH_SEP_STR); super->root = vfs_s_new_inode (vpath_element->class, super, vfs_s_default_stat (vpath_element->class, S_IFDIR | 0755)); @@ -136,18 +149,13 @@ static void sftpfs_cb_close_connection (struct vfs_class *me, struct vfs_s_super *super) { GError *mcerror = NULL; - sftpfs_super_data_t *sftpfs_super_data; (void) me; sftpfs_close_connection (super, "Normal Shutdown", &mcerror); - sftpfs_super_data = (sftpfs_super_data_t *) super->data; - if (sftpfs_super_data != NULL) - vfs_path_element_free (sftpfs_super_data->original_connection_info); + vfs_path_element_free (SUP->original_connection_info); mc_error_message (&mcerror, NULL); - - g_free (sftpfs_super_data); } /* --------------------------------------------------------------------------------------------- */ @@ -186,6 +194,7 @@ sftpfs_init_subclass (void) sftpfs_subclass.flags = VFS_S_REMOTE; sftpfs_subclass.archive_same = sftpfs_cb_is_equal_connection; + sftpfs_subclass.new_archive = sftpfs_cb_init_connection; sftpfs_subclass.open_archive = sftpfs_cb_open_connection; sftpfs_subclass.free_archive = sftpfs_cb_close_connection; sftpfs_subclass.dir_load = sftpfs_cb_dir_load; diff --git a/src/vfs/tar/tar.c b/src/vfs/tar/tar.c index 5811f0a9e..be7531053 100644 --- a/src/vfs/tar/tar.c +++ b/src/vfs/tar/tar.c @@ -61,6 +61,8 @@ /*** file scope macro definitions ****************************************************************/ +#define SUP(super) ((tar_super_data_t *) (super)) + /* * Header block on tape. * @@ -215,6 +217,8 @@ typedef enum typedef struct { + struct vfs_s_super base; /* base class */ + int fd; struct stat st; int type; /* Type of the archive */ @@ -230,6 +234,7 @@ static off_t current_tar_position = 0; static union record rec_buf; +/* --------------------------------------------------------------------------------------------- */ /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ /** @@ -263,19 +268,30 @@ tar_from_oct (int digs, const char *where) /* --------------------------------------------------------------------------------------------- */ +static struct vfs_s_super * +tar_new_archive (struct vfs_class *me) +{ + tar_super_data_t *arch; + + arch = g_new0 (tar_super_data_t, 1); + arch->base.me = me; + arch->fd = -1; + arch->type = TAR_UNKNOWN; + + return VFS_SUPER (arch); +} + +/* --------------------------------------------------------------------------------------------- */ + static void tar_free_archive (struct vfs_class *me, struct vfs_s_super *archive) { + tar_super_data_t *arch = SUP (archive); + (void) me; - if (archive->data != NULL) - { - tar_super_data_t *arch = (tar_super_data_t *) archive->data; - - if (arch->fd != -1) - mc_close (arch->fd); - g_free (archive->data); - } + if (arch->fd != -1) + mc_close (arch->fd); } /* --------------------------------------------------------------------------------------------- */ @@ -297,11 +313,8 @@ tar_open_archive_int (struct vfs_class *me, const vfs_path_t * vpath, struct vfs } archive->name = g_strdup (vfs_path_as_str (vpath)); - archive->data = g_new (tar_super_data_t, 1); - arch = (tar_super_data_t *) archive->data; + arch = SUP (archive); mc_stat (vpath, &arch->st); - arch->fd = -1; - arch->type = TAR_UNKNOWN; /* Find out the method to handle this tar file */ type = get_compression_type (result, archive->name); @@ -426,7 +439,7 @@ tar_checksum (const union record *header) static void tar_fill_stat (struct vfs_s_super *archive, struct stat *st, union record *header, size_t h_size) { - tar_super_data_t *arch = (tar_super_data_t *) archive->data; + tar_super_data_t *arch = SUP (archive); st->st_mode = tar_from_oct (8, header->header.mode); @@ -516,7 +529,7 @@ tar_fill_stat (struct vfs_s_super *archive, struct stat *st, union record *heade static ReadStatus tar_read_header (struct vfs_class *me, struct vfs_s_super *archive, int tard, size_t * h_size) { - tar_super_data_t *arch = (tar_super_data_t *) archive->data; + tar_super_data_t *arch = SUP (archive); ReadStatus checksum_status; union record *header; static char *next_long_name = NULL, *next_long_link = NULL; @@ -876,7 +889,7 @@ tar_super_same (const vfs_path_element_t * vpath_element, struct vfs_s_super *pa return 0; /* Has the cached archive been changed on the disk? */ - if (((tar_super_data_t *) parc->data)->st.st_mtime < archive_stat->st_mtime) + if (parc != NULL && SUP (parc)->st.st_mtime < archive_stat->st_mtime) { /* Yes, reload! */ vfs_tarfs_ops->free ((vfsid) parc); @@ -894,7 +907,7 @@ static ssize_t tar_read (void *fh, char *buffer, size_t count) { off_t begin = FH->ino->data_offset; - int fd = ((tar_super_data_t *) FH_SUPER->data)->fd; + int fd = SUP (FH_SUPER)->fd; struct vfs_class *me = FH_SUPER->me; ssize_t res; @@ -934,6 +947,7 @@ init_tarfs (void) tarfs_subclass.flags = VFS_S_READONLY; /* FIXME: tarfs used own temp files */ tarfs_subclass.archive_check = tar_super_check; tarfs_subclass.archive_same = tar_super_same; + tarfs_subclass.new_archive = tar_new_archive; tarfs_subclass.open_archive = tar_open_archive; tarfs_subclass.free_archive = tar_free_archive; tarfs_subclass.fh_open = tar_fh_open; From 2d58e4d624b0fbb8714a109da276b7d6f7380886 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 17 Aug 2016 14:34:37 +0300 Subject: [PATCH 05/25] VFS: make VFS-specific file handler class the derived one from vfs_file_handler_t. Signed-off-by: Andrew Borodin --- lib/vfs/direntry.c | 79 +++++++++++++++++++++++------------ lib/vfs/xdirentry.h | 6 ++- src/vfs/cpio/cpio.c | 3 +- src/vfs/fish/fish.c | 38 ++++++++--------- src/vfs/ftpfs/ftpfs.c | 34 ++++++++------- src/vfs/sftpfs/file.c | 50 ++++++++++++---------- src/vfs/sftpfs/internal.h | 2 + src/vfs/sftpfs/vfs_class.c | 1 - src/vfs/sftpfs/vfs_subclass.c | 1 + 9 files changed, 123 insertions(+), 91 deletions(-) diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 86af051b8..234d96396 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -363,6 +363,30 @@ vfs_s_free_super (struct vfs_class *me, struct vfs_s_super *super) g_free (super); } +/* --------------------------------------------------------------------------------------------- */ + +static vfs_file_handler_t * +vfs_s_new_fh (struct vfs_s_inode *ino, gboolean changed) +{ + vfs_file_handler_t *fh; + + fh = g_new0 (vfs_file_handler_t, 1); + vfs_s_init_fh (fh, ino, changed); + + return fh; +} + +/* --------------------------------------------------------------------------------------------- */ + +static void +vfs_s_free_fh (struct vfs_s_subclass *s, vfs_file_handler_t * fh) +{ + if (s->fh_free != NULL) + s->fh_free (fh); + + g_free (fh); +} + /* --------------------------------------------------------------------------------------------- */ /* Support of archives */ /* ------------------------ readdir & friends ----------------------------- */ @@ -663,9 +687,8 @@ vfs_s_close (void *fh) close (FH->handle); vfs_s_free_inode (me, FH->ino); - if (MEDATA->fh_free_data != NULL) - MEDATA->fh_free_data (fh); - g_free (fh); + vfs_s_free_fh (MEDATA, fh); + return res; } @@ -1228,6 +1251,17 @@ vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino) return g_strconcat (ino->ent->dir->ent->name, PATH_SEP_STR, ino->ent->name, (char *) NULL); } +/* --------------------------------------------------------------------------------------------- */ + +void +vfs_s_init_fh (vfs_file_handler_t * fh, struct vfs_s_inode *ino, gboolean changed) +{ + fh->ino = ino; + fh->handle = -1; + fh->changed = changed; + fh->linear = LS_NOT_LINEAR; +} + /* --------------------------------------------------------------------------------------------- */ /* --------------------------- stat and friends ---------------------------- */ @@ -1307,13 +1341,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) return NULL; } - fh = g_new (vfs_file_handler_t, 1); - fh->pos = 0; - fh->ino = ino; - fh->handle = -1; - fh->changed = was_changed; - fh->linear = LS_NOT_LINEAR; - fh->data = NULL; + fh = s->fh_new != NULL ? s->fh_new (ino, was_changed) : vfs_s_new_fh (ino, was_changed); if (IS_LINEAR (flags)) { @@ -1327,9 +1355,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) { if (s->fh_open != NULL && s->fh_open (path_element->class, fh, flags, mode) != 0) { - if (s->fh_free_data != NULL) - s->fh_free_data (fh); - g_free (fh); + vfs_s_free_fh (s, fh); return NULL; } } @@ -1339,7 +1365,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode) fh->handle = open (fh->ino->localname, NO_LINEAR (flags), mode); if (fh->handle == -1) { - g_free (fh); + vfs_s_free_fh (s, fh); path_element->class->verrno = errno; return NULL; } @@ -1388,17 +1414,13 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino) int handle; ssize_t n; off_t stat_size = ino->st.st_size; - vfs_file_handler_t fh; + vfs_file_handler_t *fh = NULL; vfs_path_t *tmp_vpath; + struct vfs_s_subclass *s = MEDATA; - if ((MEDATA->flags & VFS_S_USETMP) == 0) + if ((s->flags & VFS_S_USETMP) == 0) return (-1); - memset (&fh, 0, sizeof (fh)); - - fh.ino = ino; - fh.handle = -1; - handle = vfs_mkstemps (&tmp_vpath, me->name, ino->ent->name); ino->localname = g_strdup (vfs_path_as_str (tmp_vpath)); vfs_path_free (tmp_vpath); @@ -1408,14 +1430,16 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino) goto error_4; } - if (MEDATA->linear_start (me, &fh, 0) == 0) + fh = s->fh_new != NULL ? s->fh_new (ino, FALSE) : vfs_s_new_fh (ino, FALSE); + + if (s->linear_start (me, fh, 0) == 0) goto error_3; /* Clear the interrupt status */ tty_got_interrupt (); tty_enable_interrupt_key (); - while ((n = MEDATA->linear_read (me, &fh, buffer, sizeof (buffer))) != 0) + while ((n = s->linear_read (me, fh, buffer, sizeof (buffer))) != 0) { int t; @@ -1436,22 +1460,23 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino) goto error_1; } } - MEDATA->linear_close (me, &fh); + s->linear_close (me, fh); close (handle); tty_disable_interrupt_key (); - g_free (fh.data); + vfs_s_free_fh (s, fh); return 0; error_1: - MEDATA->linear_close (me, &fh); + s->linear_close (me, fh); error_3: tty_disable_interrupt_key (); close (handle); unlink (ino->localname); error_4: MC_PTR_FREE (ino->localname); - g_free (fh.data); + if (fh != NULL) + vfs_s_free_fh (s, fh); return (-1); } diff --git a/lib/vfs/xdirentry.h b/lib/vfs/xdirentry.h index d3a17d30a..f51ddd040 100644 --- a/lib/vfs/xdirentry.h +++ b/lib/vfs/xdirentry.h @@ -111,7 +111,6 @@ typedef struct int handle; /* This is for module's use, but if != -1, will be mc_close()d */ gboolean changed; /* Did this file change? */ vfs_linear_state_t linear; /* Is that file open with O_LINEAR? */ - void *data; /* This is for filesystem-specific use */ } vfs_file_handler_t; /* @@ -142,9 +141,10 @@ struct vfs_s_subclass const vfs_path_t * vpath, const vfs_path_element_t * vpath_element); void (*free_archive) (struct vfs_class * me, struct vfs_s_super * psup); + vfs_file_handler_t *(*fh_new) (struct vfs_s_inode * ino, gboolean changed); int (*fh_open) (struct vfs_class * me, vfs_file_handler_t * fh, int flags, mode_t mode); int (*fh_close) (struct vfs_class * me, vfs_file_handler_t * fh); - void (*fh_free_data) (vfs_file_handler_t * fh); + void (*fh_free) (vfs_file_handler_t * fh); struct vfs_s_entry *(*find_entry) (struct vfs_class * me, struct vfs_s_inode * root, @@ -189,6 +189,8 @@ struct vfs_s_super *vfs_get_super_by_vpath (const vfs_path_t * vpath); void vfs_s_invalidate (struct vfs_class *me, struct vfs_s_super *super); char *vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino); +void vfs_s_init_fh (vfs_file_handler_t * fh, struct vfs_s_inode *ino, gboolean changed); + /* network filesystems support */ int vfs_s_select_on_two (int fd1, int fd2); int vfs_s_get_line (struct vfs_class *me, int sock, char *buf, int buf_len, char term); diff --git a/src/vfs/cpio/cpio.c b/src/vfs/cpio/cpio.c index 21fb5d1da..46f4bb32d 100644 --- a/src/vfs/cpio/cpio.c +++ b/src/vfs/cpio/cpio.c @@ -871,10 +871,9 @@ cpio_read (void *fh, char *buffer, size_t count) static int cpio_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t mode) { + (void) fh; (void) mode; - fh->data = NULL; - if ((flags & O_ACCMODE) != O_RDONLY) ERRNOR (EROFS, -1); return 0; diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c index ae87c9110..f075235f6 100644 --- a/src/vfs/fish/fish.c +++ b/src/vfs/fish/fish.c @@ -118,6 +118,7 @@ int fish_directory_timeout = 900; #define FISH_HAVE_TAIL 64 #define SUP ((fish_super_data_t *) super) +#define FISH_FH ((fish_fh_data_t *) fh) /*** file scope type declarations ****************************************************************/ @@ -148,6 +149,8 @@ typedef struct typedef struct { + vfs_file_handler_t base; /* base class */ + off_t got; off_t total; gboolean append; @@ -957,7 +960,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) static int fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char *localname) { - fish_fh_data_t *fish = (fish_fh_data_t *) fh->data; + fish_fh_data_t *fish = FISH_FH; struct vfs_s_super *super = FH_SUPER; int code; off_t total = 0; @@ -1066,16 +1069,11 @@ fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char static int fish_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) { - fish_fh_data_t *fish; + fish_fh_data_t *fish = FISH_FH; struct vfs_s_super *super = FH_SUPER; char *name; char *quoted_name; - if (fh->data == NULL) - fh->data = g_new0 (fish_fh_data_t, 1); - - fish = (fish_fh_data_t *) fh->data; - name = vfs_s_fullpath (me, fh->ino); if (name == NULL) return 0; @@ -1116,7 +1114,7 @@ fish_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) static void fish_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh) { - fish_fh_data_t *fish = (fish_fh_data_t *) fh->data; + fish_fh_data_t *fish = FISH_FH; struct vfs_s_super *super = FH_SUPER; char buffer[BUF_8K]; ssize_t n; @@ -1147,7 +1145,7 @@ fish_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh) static ssize_t fish_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size_t len) { - fish_fh_data_t *fish = (fish_fh_data_t *) fh->data; + fish_fh_data_t *fish = FISH_FH; struct vfs_s_super *super = FH_SUPER; ssize_t n = 0; @@ -1175,7 +1173,7 @@ fish_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size static void fish_linear_close (struct vfs_class *me, vfs_file_handler_t * fh) { - fish_fh_data_t *fish = (fish_fh_data_t *) fh->data; + fish_fh_data_t *fish = FISH_FH; if (fish->total != fish->got) fish_linear_abort (me, fh); @@ -1626,11 +1624,15 @@ fish_rmdir (const vfs_path_t * vpath) /* --------------------------------------------------------------------------------------------- */ -static void -fish_fh_free_data (vfs_file_handler_t * fh) +static vfs_file_handler_t * +fish_fh_new (struct vfs_s_inode *ino, gboolean changed) { - if (fh != NULL) - MC_PTR_FREE (fh->data); + fish_fh_data_t *fh; + + fh = g_new0 (fish_fh_data_t, 1); + vfs_s_init_fh ((vfs_file_handler_t *) fh, ino, changed); + + return FH; } /* --------------------------------------------------------------------------------------------- */ @@ -1638,13 +1640,10 @@ fish_fh_free_data (vfs_file_handler_t * fh) static int fish_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t mode) { - fish_fh_data_t *fish; + fish_fh_data_t *fish = FISH_FH; (void) mode; - fh->data = g_new0 (fish_fh_data_t, 1); - fish = (fish_fh_data_t *) fh->data; - /* File will be written only, so no need to retrieve it */ if (((flags & O_WRONLY) == O_WRONLY) && ((flags & (O_RDONLY | O_RDWR)) == 0)) { @@ -1676,7 +1675,6 @@ fish_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t m return 0; fail: - fish_fh_free_data (fh); return -1; } @@ -1748,8 +1746,8 @@ init_fish (void) fish_subclass.new_archive = fish_new_archive; fish_subclass.open_archive = fish_open_archive; fish_subclass.free_archive = fish_free_archive; + fish_subclass.fh_new = fish_fh_new; fish_subclass.fh_open = fish_fh_open; - fish_subclass.fh_free_data = fish_fh_free_data; fish_subclass.dir_load = fish_dir_load; fish_subclass.file_store = fish_file_store; fish_subclass.linear_start = fish_linear_start; diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c index a1cb20cee..a135e14b5 100644 --- a/src/vfs/ftpfs/ftpfs.c +++ b/src/vfs/ftpfs/ftpfs.c @@ -154,7 +154,8 @@ gboolean ftpfs_ignore_chattr_errors = TRUE; #endif #define SUP ((ftp_super_data_t *) super) -#define FH_SOCK ((ftp_fh_data_t *) fh)->sock +#define FTP_FH ((ftp_fh_data_t *) fh) +#define FH_SOCK FTP_FH->sock #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff @@ -224,6 +225,8 @@ typedef struct typedef struct { + vfs_file_handler_t base; /* base class */ + int sock; int append; } ftp_fh_data_t; @@ -1850,7 +1853,7 @@ ftpfs_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, cha struct stat s; char *w_buf; struct vfs_s_super *super = FH_SUPER; - ftp_fh_data_t *ftp = (ftp_fh_data_t *) fh->data; + ftp_fh_data_t *ftp = FTP_FH; h = open (localname, O_RDONLY); if (h == -1) @@ -1934,9 +1937,6 @@ ftpfs_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) { char *name; - if (fh->data == NULL) - fh->data = g_new0 (ftp_fh_data_t, 1); - name = vfs_s_fullpath (me, fh->ino); if (name == NULL) return 0; @@ -1945,7 +1945,7 @@ ftpfs_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset) if (FH_SOCK == -1) ERRNOR (EACCES, 0); fh->linear = LS_LINEAR_OPEN; - ((ftp_fh_data_t *) fh->data)->append = 0; + FTP_FH->append = 0; return 1; } @@ -2006,7 +2006,7 @@ ftpfs_ctl (void *fh, int ctlop, void *arg) if (FH->linear == LS_LINEAR_CLOSED || FH->linear == LS_LINEAR_PREOPEN) return 0; - v = vfs_s_select_on_two (((ftp_fh_data_t *) (FH->data))->sock, 0); + v = vfs_s_select_on_two (FH_SOCK, 0); return (((v < 0) && (errno == EINTR)) || v == 0) ? 1 : 0; } default: @@ -2197,11 +2197,16 @@ ftpfs_rmdir (const vfs_path_t * vpath) /* --------------------------------------------------------------------------------------------- */ -static void -ftpfs_fh_free_data (vfs_file_handler_t * fh) +static vfs_file_handler_t * +ftpfs_fh_new (struct vfs_s_inode *ino, gboolean changed) { - if (fh != NULL) - MC_PTR_FREE (fh->data); + ftp_fh_data_t *fh; + + fh = g_new0 (ftp_fh_data_t, 1); + vfs_s_init_fh ((vfs_file_handler_t *) fh, ino, changed); + fh->sock = -1; + + return FH; } /* --------------------------------------------------------------------------------------------- */ @@ -2209,12 +2214,10 @@ ftpfs_fh_free_data (vfs_file_handler_t * fh) static int ftpfs_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t mode) { - ftp_fh_data_t *ftp; + ftp_fh_data_t *ftp = FTP_FH; (void) mode; - fh->data = g_new0 (ftp_fh_data_t, 1); - ftp = (ftp_fh_data_t *) fh->data; /* File will be written only, so no need to retrieve it from ftp server */ if (((flags & O_WRONLY) == O_WRONLY) && ((flags & (O_RDONLY | O_RDWR)) == 0)) { @@ -2280,7 +2283,6 @@ ftpfs_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t return 0; fail: - ftpfs_fh_free_data (fh); return -1; } @@ -2657,9 +2659,9 @@ init_ftpfs (void) ftpfs_subclass.new_archive = ftpfs_new_archive; ftpfs_subclass.open_archive = ftpfs_open_archive; ftpfs_subclass.free_archive = ftpfs_free_archive; + ftpfs_subclass.fh_new = ftpfs_fh_new; ftpfs_subclass.fh_open = ftpfs_fh_open; ftpfs_subclass.fh_close = ftpfs_fh_close; - ftpfs_subclass.fh_free_data = ftpfs_fh_free_data; ftpfs_subclass.dir_load = ftpfs_dir_load; ftpfs_subclass.file_store = ftpfs_file_store; ftpfs_subclass.linear_start = ftpfs_linear_start; diff --git a/src/vfs/sftpfs/file.c b/src/vfs/sftpfs/file.c index 6001f3b37..db200588e 100644 --- a/src/vfs/sftpfs/file.c +++ b/src/vfs/sftpfs/file.c @@ -39,10 +39,14 @@ /*** file scope macro definitions ****************************************************************/ +#define SFTP_FH ((sftpfs_file_handler_data_t *) file_handler) + /*** file scope type declarations ****************************************************************/ typedef struct { + vfs_file_handler_t base; /* base class */ + LIBSSH2_SFTP_HANDLE *handle; int flags; mode_t mode; @@ -62,13 +66,12 @@ typedef struct static void sftpfs_reopen (vfs_file_handler_t * file_handler, GError ** mcerror) { - sftpfs_file_handler_data_t *file_handler_data; + sftpfs_file_handler_data_t *file_handler_data = SFTP_FH; int flags; mode_t mode; g_return_if_fail (mcerror == NULL || *mcerror == NULL); - file_handler_data = (sftpfs_file_handler_data_t *) file_handler->data; flags = file_handler_data->flags; mode = file_handler_data->mode; @@ -95,6 +98,19 @@ sftpfs_file__handle_error (sftpfs_super_data_t * super_data, int sftp_res, GErro /* --------------------------------------------------------------------------------------------- */ /*** public functions ****************************************************************************/ +/* --------------------------------------------------------------------------------------------- */ + +vfs_file_handler_t * +sftpfs_fh_new (struct vfs_s_inode * ino, gboolean changed) +{ + sftpfs_file_handler_data_t *fh; + + fh = g_new0 (sftpfs_file_handler_data_t, 1); + vfs_s_init_fh ((vfs_file_handler_t *) fh, ino, changed); + + return FH; +} + /* --------------------------------------------------------------------------------------------- */ /** * Open new SFTP file. @@ -112,7 +128,7 @@ sftpfs_open_file (vfs_file_handler_t * file_handler, int flags, mode_t mode, GEr unsigned long sftp_open_flags = 0; int sftp_open_mode = 0; gboolean do_append = FALSE; - sftpfs_file_handler_data_t *file_handler_data; + sftpfs_file_handler_data_t *file_handler_data = SFTP_FH; sftpfs_super_data_t *super_data; char *name; @@ -124,7 +140,6 @@ sftpfs_open_file (vfs_file_handler_t * file_handler, int flags, mode_t mode, GEr return FALSE; super_data = (sftpfs_super_data_t *) file_handler->ino->super; - file_handler_data = g_new0 (sftpfs_file_handler_data_t, 1); if ((flags & O_CREAT) != 0 || (flags & O_WRONLY) != 0) { @@ -171,7 +186,6 @@ sftpfs_open_file (vfs_file_handler_t * file_handler, int flags, mode_t mode, GEr file_handler_data->flags = flags; file_handler_data->mode = mode; - file_handler->data = file_handler_data; if (do_append) { @@ -212,7 +226,7 @@ sftpfs_fstat (void *data, struct stat *buf, GError ** mcerror) int res; LIBSSH2_SFTP_ATTRIBUTES attrs; vfs_file_handler_t *fh = (vfs_file_handler_t *) data; - sftpfs_file_handler_data_t *sftpfs_fh = fh->data; + sftpfs_file_handler_data_t *sftpfs_fh = (sftpfs_file_handler_data_t *) data; struct vfs_s_super *super = fh->ino->super; sftpfs_super_data_t *super_data = SUP; @@ -256,19 +270,18 @@ ssize_t sftpfs_read_file (vfs_file_handler_t * file_handler, char *buffer, size_t count, GError ** mcerror) { ssize_t rc; - sftpfs_file_handler_data_t *file_handler_data; + sftpfs_file_handler_data_t *file_handler_data = SFTP_FH; sftpfs_super_data_t *super_data; mc_return_val_if_error (mcerror, -1); - if (file_handler == NULL || file_handler->data == NULL) + if (file_handler == NULL) { mc_propagate_error (mcerror, 0, "%s", _("sftp: No file handler data present for reading file")); return -1; } - file_handler_data = file_handler->data; super_data = (sftpfs_super_data_t *) file_handler->ino->super; do @@ -308,12 +321,11 @@ sftpfs_write_file (vfs_file_handler_t * file_handler, const char *buffer, size_t GError ** mcerror) { ssize_t rc; - sftpfs_file_handler_data_t *file_handler_data; + sftpfs_file_handler_data_t *file_handler_data = SFTP_FH; sftpfs_super_data_t *super_data; mc_return_val_if_error (mcerror, -1); - file_handler_data = (sftpfs_file_handler_data_t *) file_handler->data; super_data = (sftpfs_super_data_t *) file_handler->ino->super; file_handler->pos = (off_t) libssh2_sftp_tell64 (file_handler_data->handle); @@ -349,19 +361,13 @@ sftpfs_write_file (vfs_file_handler_t * file_handler, const char *buffer, size_t int sftpfs_close_file (vfs_file_handler_t * file_handler, GError ** mcerror) { - sftpfs_file_handler_data_t *file_handler_data; - int ret = -1; + int ret; mc_return_val_if_error (mcerror, -1); - file_handler_data = (sftpfs_file_handler_data_t *) file_handler->data; - if (file_handler_data != NULL) - { - ret = libssh2_sftp_close (file_handler_data->handle); - g_free (file_handler_data); - } + ret = libssh2_sftp_close (SFTP_FH->handle); - return ret; + return ret == 0 ? 0 : -1; } /* --------------------------------------------------------------------------------------------- */ @@ -380,7 +386,7 @@ sftpfs_close_file (vfs_file_handler_t * file_handler, GError ** mcerror) off_t sftpfs_lseek (vfs_file_handler_t * file_handler, off_t offset, int whence, GError ** mcerror) { - sftpfs_file_handler_data_t *file_handler_data; + sftpfs_file_handler_data_t *file_handler_data = SFTP_FH; mc_return_val_if_error (mcerror, 0); @@ -413,8 +419,6 @@ sftpfs_lseek (vfs_file_handler_t * file_handler, off_t offset, int whence, GErro break; } - file_handler_data = (sftpfs_file_handler_data_t *) file_handler->data; - libssh2_sftp_seek64 (file_handler_data->handle, file_handler->pos); file_handler->pos = (off_t) libssh2_sftp_tell64 (file_handler_data->handle); diff --git a/src/vfs/sftpfs/internal.h b/src/vfs/sftpfs/internal.h index 4846f5666..ae4386b9e 100644 --- a/src/vfs/sftpfs/internal.h +++ b/src/vfs/sftpfs/internal.h @@ -89,6 +89,8 @@ int sftpfs_open_connection (struct vfs_s_super *super, GError ** mcerror); void sftpfs_close_connection (struct vfs_s_super *super, const char *shutdown_message, GError ** mcerror); +vfs_file_handler_t *sftpfs_fh_new (struct vfs_s_inode *ino, gboolean changed); + void *sftpfs_opendir (const vfs_path_t * vpath, GError ** mcerror); void *sftpfs_readdir (void *data, GError ** mcerror); int sftpfs_closedir (void *data, GError ** mcerror); diff --git a/src/vfs/sftpfs/vfs_class.c b/src/vfs/sftpfs/vfs_class.c index 6a1a56547..59e85d037 100644 --- a/src/vfs/sftpfs/vfs_class.c +++ b/src/vfs/sftpfs/vfs_class.c @@ -149,7 +149,6 @@ sftpfs_cb_open (const vfs_path_t * vpath, int flags, mode_t mode) file_handler->handle = -1; file_handler->changed = is_changed; file_handler->linear = LS_NOT_LINEAR; - file_handler->data = NULL; if (!sftpfs_open_file (file_handler, flags, mode, &mcerror)) { diff --git a/src/vfs/sftpfs/vfs_subclass.c b/src/vfs/sftpfs/vfs_subclass.c index 3abddbcbe..b8116a9ef 100644 --- a/src/vfs/sftpfs/vfs_subclass.c +++ b/src/vfs/sftpfs/vfs_subclass.c @@ -197,6 +197,7 @@ sftpfs_init_subclass (void) sftpfs_subclass.new_archive = sftpfs_cb_init_connection; sftpfs_subclass.open_archive = sftpfs_cb_open_connection; sftpfs_subclass.free_archive = sftpfs_cb_close_connection; + sftpfs_subclass.fh_new = sftpfs_fh_new; sftpfs_subclass.dir_load = sftpfs_cb_dir_load; } From 7f9fb38176f9fe4ca066733f488117f620df7fd8 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 1 Mar 2018 13:58:45 +0300 Subject: [PATCH 06/25] extfs: refactoring: use GSList to store archive list. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 100 ++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 00e262bfa..9d8a4684d 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -122,7 +122,6 @@ struct archive int fd_usage; ino_t inode_counter; struct entry *root_entry; - struct archive *next; }; typedef struct @@ -142,9 +141,10 @@ static gboolean notadir; static struct vfs_s_subclass extfs_subclass; static struct vfs_class *vfs_extfs_ops = (struct vfs_class *) &extfs_subclass; -static struct archive *first_archive = NULL; +static GSList *first_archive = NULL; static int my_errno = 0; +/* --------------------------------------------------------------------------------------------- */ /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ @@ -155,6 +155,35 @@ static struct entry *extfs_resolve_symlinks_int (struct entry *entry, GSList * l /* --------------------------------------------------------------------------------------------- */ +static void +extfs_fill_name (void *data, void *user_data) +{ + struct archive *a = (struct archive *) data; + fill_names_f func = (fill_names_f) user_data; + extfs_plugin_info_t *info; + char *name; + + info = &g_array_index (extfs_plugins, extfs_plugin_info_t, a->fstype); + name = + g_strconcat (a->name != NULL ? a->name : "", PATH_SEP_STR, info->prefix, + VFS_PATH_URL_DELIMITER, (char *) NULL); + func (name); + g_free (name); +} + +/* --------------------------------------------------------------------------------------------- */ + +static gint +extfs_cmp_archive (const void *a, const void *b) +{ + const struct archive *ar = (const struct archive *) a; + const char *archive_name = (const char *) b; + + return (ar->name != NULL && strcmp (ar->name, archive_name) == 0) ? 0 : 1; +} + +/* --------------------------------------------------------------------------------------------- */ + static void extfs_make_dots (struct entry *ent) { @@ -349,23 +378,9 @@ extfs_find_entry (struct entry *dir, const char *name, gboolean make_dirs, gbool static void extfs_fill_names (struct vfs_class *me, fill_names_f func) { - struct archive *a = first_archive; - (void) me; - while (a != NULL) - { - extfs_plugin_info_t *info; - char *name; - - info = &g_array_index (extfs_plugins, extfs_plugin_info_t, a->fstype); - name = - g_strconcat (a->name ? a->name : "", PATH_SEP_STR, info->prefix, VFS_PATH_URL_DELIMITER, - (char *) NULL); - func (name); - g_free (name); - a = a->next; - } + g_slist_foreach (first_archive, extfs_fill_name, func); } /* --------------------------------------------------------------------------------------------- */ @@ -374,6 +389,7 @@ static void extfs_free_archive (struct archive *archive) { extfs_free_entry (archive->root_entry); + if (archive->local_name != NULL) { struct stat my; @@ -463,8 +479,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) current_archive->inode_counter = 0; current_archive->fd_usage = 0; current_archive->rdev = archive_counter++; - current_archive->next = first_archive; - first_archive = current_archive; + first_archive = g_slist_prepend (first_archive, current_archive); mode = mystat.st_mode & 07777; if (mode & 0400) mode |= 0100; @@ -671,9 +686,10 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean { char *archive_name; int result = -1; - struct archive *parc; + GSList *parc; int fstype; const vfs_path_element_t *path_element; + struct archive *a = NULL; path_element = vfs_path_get_by_index (vpath, -1); @@ -687,18 +703,16 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean * All filesystems should have some local archive, at least * it can be PATH_SEP ('/'). */ - for (parc = first_archive; parc != NULL; parc = parc->next) - if (parc->name != NULL) - { - if (strcmp (parc->name, archive_name) == 0) - { - vfs_stamp (vfs_extfs_ops, (vfsid) parc); - g_free (archive_name); - goto return_success; - } - } + parc = g_slist_find_custom (first_archive, archive_name, extfs_cmp_archive); + if (parc != NULL) + { + a = (struct archive *) parc->data; + vfs_stamp (vfs_extfs_ops, (vfsid) a); + g_free (archive_name); + goto return_success; + } - result = do_not_open ? -1 : extfs_read_archive (fstype, archive_name, &parc); + result = do_not_open ? -1 : extfs_read_archive (fstype, archive_name, &a); g_free (archive_name); if (result == -1) { @@ -707,7 +721,7 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean } return_success: - *archive = parc; + *archive = a; return path_element->path; } @@ -1491,20 +1505,7 @@ extfs_free (vfsid id) { struct archive *archive = (struct archive *) id; - if (archive == first_archive) - { - first_archive = archive->next; - } - else - { - struct archive *parc; - for (parc = first_archive; parc != NULL; parc = parc->next) - if (parc->next == archive) - { - parc->next = archive->next; - break; - } - } + first_archive = g_slist_remove (first_archive, archive); extfs_free_archive (archive); } @@ -1680,15 +1681,10 @@ static void extfs_done (struct vfs_class *me) { size_t i; - struct archive *ar; (void) me; - for (ar = first_archive; ar != NULL;) - { - extfs_free ((vfsid) ar); - ar = first_archive; - } + g_slist_free_full (first_archive, (GDestroyNotify) extfs_free_archive); if (extfs_plugins == NULL) return; From e86ba483c6f646c45b7e3f4ecceb17813561de51 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 1 Mar 2018 14:52:06 +0300 Subject: [PATCH 07/25] extfs: refactoring: struct inode: use struct stat instead of separate members. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 127 ++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 74 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 9d8a4684d..6abcc4f52 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -78,21 +78,11 @@ struct inode { - nlink_t nlink; struct entry *first_in_subdir; /* only used if this is a directory */ struct entry *last_in_subdir; - ino_t inode; /* This is inode # */ - dev_t dev; /* This is an internal identification of the extfs archive */ + struct stat st; struct archive *archive; /* And this is an archive structure */ - dev_t rdev; - mode_t mode; - uid_t uid; - gid_t gid; - off_t size; - time_t mtime; char *linkname; - time_t atime; - time_t ctime; char *local_filename; }; @@ -197,7 +187,7 @@ extfs_make_dots (struct entry *ent) entry->dir = ent; inode->local_filename = NULL; inode->first_in_subdir = entry; - inode->nlink++; + inode->st.st_nlink++; entry->next_in_dir = g_new (struct entry, 1); entry = entry->next_in_dir; @@ -208,13 +198,13 @@ extfs_make_dots (struct entry *ent) { entry->inode = parent; entry->dir = parentry; - parent->nlink++; + parent->st.st_nlink++; } else { entry->inode = inode; entry->dir = ent; - inode->nlink++; + inode->st.st_nlink++; } } @@ -244,21 +234,21 @@ extfs_generate_entry (struct archive *archive, inode->local_filename = NULL; inode->linkname = NULL; inode->last_in_subdir = NULL; - inode->inode = (archive->inode_counter)++; - inode->dev = archive->rdev; + inode->st.st_ino = archive->inode_counter++; + inode->st.st_dev = archive->rdev; inode->archive = archive; myumask = umask (022); umask (myumask); - inode->mode = mode & ~myumask; - mode = inode->mode; - inode->rdev = 0; - inode->uid = getuid (); - inode->gid = getgid (); - inode->size = 0; - inode->mtime = time (NULL); - inode->atime = inode->mtime; - inode->ctime = inode->mtime; - inode->nlink = 1; + inode->st.st_mode = mode & ~myumask; + mode = inode->st.st_mode; + inode->st.st_rdev = 0; + inode->st.st_uid = getuid (); + inode->st.st_gid = getgid (); + inode->st.st_size = 0; + inode->st.st_mtime = time (NULL); + inode->st.st_atime = inode->st.st_mtime; + inode->st.st_ctime = inode->st.st_mtime; + inode->st.st_nlink = 1; if (S_ISDIR (mode)) extfs_make_dots (entry); return entry; @@ -307,7 +297,7 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, *q = c; return NULL; } - if (!S_ISDIR (pent->inode->mode)) + if (!S_ISDIR (pent->inode->st.st_mode)) { *q = c; notadir = TRUE; @@ -323,7 +313,7 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, if (q + 1 > name_end) { *q = c; - notadir = !S_ISDIR (pent->inode->mode); + notadir = !S_ISDIR (pent->inode->st.st_mode); return pent; } break; @@ -489,11 +479,11 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) mode |= 0001; mode |= S_IFDIR; root_entry = extfs_generate_entry (current_archive, PATH_SEP_STR, NULL, mode); - root_entry->inode->uid = mystat.st_uid; - root_entry->inode->gid = mystat.st_gid; - root_entry->inode->atime = mystat.st_atime; - root_entry->inode->ctime = mystat.st_ctime; - root_entry->inode->mtime = mystat.st_mtime; + root_entry->inode->st.st_uid = mystat.st_uid; + root_entry->inode->st.st_gid = mystat.st_gid; + root_entry->inode->st.st_atime = mystat.st_atime; + root_entry->inode->st.st_ctime = mystat.st_ctime; + root_entry->inode->st.st_mtime = mystat.st_mtime; current_archive->root_entry = root_entry; *pparc = current_archive; @@ -592,29 +582,29 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) } entry->inode = pent->inode; - pent->inode->nlink++; + pent->inode->st.st_nlink++; } else { inode = g_new (struct inode, 1); entry->inode = inode; inode->local_filename = NULL; - inode->inode = (current_archive->inode_counter)++; - inode->nlink = 1; - inode->dev = current_archive->rdev; + inode->st.st_ino = current_archive->inode_counter++; + inode->st.st_nlink = 1; + inode->st.st_dev = current_archive->rdev; inode->archive = current_archive; - inode->mode = hstat.st_mode; + inode->st.st_mode = hstat.st_mode; #ifdef HAVE_STRUCT_STAT_ST_RDEV - inode->rdev = hstat.st_rdev; + inode->st.st_rdev = hstat.st_rdev; #else - inode->rdev = 0; + inode->st.st_rdev = 0; #endif - inode->uid = hstat.st_uid; - inode->gid = hstat.st_gid; - inode->size = hstat.st_size; - inode->mtime = hstat.st_mtime; - inode->atime = hstat.st_atime; - inode->ctime = hstat.st_ctime; + inode->st.st_uid = hstat.st_uid; + inode->st.st_gid = hstat.st_gid; + inode->st.st_size = hstat.st_size; + inode->st.st_mtime = hstat.st_mtime; + inode->st.st_atime = hstat.st_atime; + inode->st.st_ctime = hstat.st_ctime; inode->first_in_subdir = NULL; inode->last_in_subdir = NULL; if (current_link_name != NULL && S_ISLNK (hstat.st_mode)) @@ -625,7 +615,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) else { if (S_ISLNK (hstat.st_mode)) - inode->mode &= ~S_IFLNK; /* You *DON'T* want to do this always */ + inode->st.st_mode &= ~S_IFLNK; /* You *DON'T* want to do this always */ inode->linkname = NULL; } if (S_ISDIR (hstat.st_mode)) @@ -765,7 +755,7 @@ extfs_resolve_symlinks_int (struct entry *entry, GSList * list) { struct entry *pent = NULL; - if (!S_ISLNK (entry->inode->mode)) + if (!S_ISLNK (entry->inode->st.st_mode)) return entry; if (g_slist_find (list, entry) != NULL) @@ -931,7 +921,7 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) if (entry == NULL) return NULL; - if (S_ISDIR (entry->inode->mode)) + if (S_ISDIR (entry->inode->st.st_mode)) ERRNOR (EISDIR, NULL); if (entry->inode->local_filename == NULL) @@ -1014,9 +1004,9 @@ extfs_close (void *data) if (stat (file->entry->inode->local_filename, &file_status) != 0) errno_code = EIO; else - file->entry->inode->size = file_status.st_size; + file->entry->inode->st.st_size = file_status.st_size; - file->entry->inode->mtime = time (NULL); + file->entry->inode->st.st_mtime = time (NULL); } if (--file->archive->fd_usage == 0) @@ -1057,7 +1047,7 @@ extfs_opendir (const vfs_path_t * vpath) entry = extfs_resolve_symlinks (entry); if (entry == NULL) return NULL; - if (!S_ISDIR (entry->inode->mode)) + if (!S_ISDIR (entry->inode->st.st_mode)) ERRNOR (ENOTDIR, NULL); info = g_new (struct entry *, 2); @@ -1099,23 +1089,12 @@ extfs_closedir (void *data) static void extfs_stat_move (struct stat *buf, const struct inode *inode) { - buf->st_dev = inode->dev; - buf->st_ino = inode->inode; - buf->st_mode = inode->mode; - buf->st_nlink = inode->nlink; - buf->st_uid = inode->uid; - buf->st_gid = inode->gid; -#ifdef HAVE_STRUCT_STAT_ST_RDEV - buf->st_rdev = inode->rdev; -#endif - buf->st_size = inode->size; + *buf = inode->st; + #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE buf->st_blksize = RECORDSIZE; #endif vfs_adjust_stat (buf); - buf->st_atime = inode->atime; - buf->st_mtime = inode->mtime; - buf->st_ctime = inode->ctime; #ifdef HAVE_STRUCT_STAT_ST_MTIM buf->st_atim.tv_nsec = buf->st_mtim.tv_nsec = buf->st_ctim.tv_nsec = 0; #endif @@ -1193,7 +1172,7 @@ extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); if (entry == NULL) goto cleanup; - if (!S_ISLNK (entry->inode->mode)) + if (!S_ISLNK (entry->inode->st.st_mode)) { const vfs_path_element_t *path_element; @@ -1262,7 +1241,7 @@ extfs_unlink (const vfs_path_t * vpath) entry = extfs_resolve_symlinks (entry); if (entry == NULL) goto cleanup; - if (S_ISDIR (entry->inode->mode)) + if (S_ISDIR (entry->inode->st.st_mode)) { const vfs_path_element_t *path_element; @@ -1310,7 +1289,7 @@ extfs_mkdir (const vfs_path_t * vpath, mode_t mode) entry = extfs_resolve_symlinks (entry); if (entry == NULL) goto cleanup; - if (!S_ISDIR (entry->inode->mode)) + if (!S_ISDIR (entry->inode->st.st_mode)) { path_element->class->verrno = ENOTDIR; goto cleanup; @@ -1346,7 +1325,7 @@ extfs_rmdir (const vfs_path_t * vpath) entry = extfs_resolve_symlinks (entry); if (entry == NULL) goto cleanup; - if (!S_ISDIR (entry->inode->mode)) + if (!S_ISDIR (entry->inode->st.st_mode)) { const vfs_path_element_t *path_element; @@ -1384,7 +1363,7 @@ extfs_chdir (const vfs_path_t * vpath) if (entry == NULL) return -1; entry = extfs_resolve_symlinks (entry); - if ((entry == NULL) || (!S_ISDIR (entry->inode->mode))) + if ((entry == NULL) || (!S_ISDIR (entry->inode->st.st_mode))) return -1; my_errno = 0; return 0; @@ -1428,10 +1407,10 @@ extfs_nothingisopen (vfsid id) static void extfs_remove_entry (struct entry *e) { - int i = --e->inode->nlink; + int i = --e->inode->st.st_nlink; struct entry *pe, *ent, *prev; - if (S_ISDIR (e->inode->mode) && e->inode->first_in_subdir != NULL) + if (S_ISDIR (e->inode->st.st_mode) && e->inode->first_in_subdir != NULL) { struct entry *f = e->inode->first_in_subdir; e->inode->first_in_subdir = NULL; @@ -1473,9 +1452,9 @@ extfs_remove_entry (struct entry *e) static void extfs_free_entry (struct entry *e) { - int i = --e->inode->nlink; + int i = --e->inode->st.st_nlink; - if (S_ISDIR (e->inode->mode) && e->inode->first_in_subdir != NULL) + if (S_ISDIR (e->inode->st.st_mode) && e->inode->first_in_subdir != NULL) { struct entry *f = e->inode->first_in_subdir; From 81945d32ce0c0e5e234a1c0f96d135ab44c5fe78 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 3 Mar 2018 11:06:08 +0300 Subject: [PATCH 08/25] extfs: refactoring: rename some structure members... to unify it with standard VFS structures. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 186 +++++++++++++++++++++--------------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 6abcc4f52..12e6222f6 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -83,7 +83,7 @@ struct inode struct stat st; struct archive *archive; /* And this is an archive structure */ char *linkname; - char *local_filename; + char *localname; }; struct entry @@ -91,14 +91,14 @@ struct entry struct entry *next_in_dir; struct entry *dir; char *name; - struct inode *inode; + struct inode *ino; }; struct pseudofile { struct archive *archive; - gboolean has_changed; - int local_handle; + gboolean changed; + int handle; struct entry *entry; }; @@ -110,7 +110,7 @@ struct archive struct stat local_stat; dev_t rdev; int fd_usage; - ino_t inode_counter; + ino_t ino_usage; struct entry *root_entry; }; @@ -179,13 +179,13 @@ extfs_make_dots (struct entry *ent) { struct entry *entry = g_new (struct entry, 1); struct entry *parentry = ent->dir; - struct inode *inode = ent->inode, *parent; + struct inode *inode = ent->ino, *parent; - parent = (parentry != NULL) ? parentry->inode : NULL; + parent = (parentry != NULL) ? parentry->ino : NULL; entry->name = g_strdup ("."); - entry->inode = inode; + entry->ino = inode; entry->dir = ent; - inode->local_filename = NULL; + inode->localname = NULL; inode->first_in_subdir = entry; inode->st.st_nlink++; @@ -196,13 +196,13 @@ extfs_make_dots (struct entry *ent) entry->next_in_dir = NULL; if (parent != NULL) { - entry->inode = parent; + entry->ino = parent; entry->dir = parentry; parent->st.st_nlink++; } else { - entry->inode = inode; + entry->ino = inode; entry->dir = ent; inode->st.st_nlink++; } @@ -218,7 +218,7 @@ extfs_generate_entry (struct archive *archive, struct inode *inode, *parent; struct entry *entry; - parent = (parentry != NULL) ? parentry->inode : NULL; + parent = (parentry != NULL) ? parentry->ino : NULL; entry = g_new (struct entry, 1); entry->name = g_strdup (name); @@ -230,11 +230,11 @@ extfs_generate_entry (struct archive *archive, parent->last_in_subdir = entry; } inode = g_new (struct inode, 1); - entry->inode = inode; - inode->local_filename = NULL; + entry->ino = inode; + inode->localname = NULL; inode->linkname = NULL; inode->last_in_subdir = NULL; - inode->st.st_ino = archive->inode_counter++; + inode->st.st_ino = archive->ino_usage++; inode->st.st_dev = archive->rdev; inode->archive = archive; myumask = umask (022); @@ -269,7 +269,7 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, { /* Handle absolute paths */ name = g_path_skip_root (name); - dir = dir->inode->archive->root_entry; + dir = dir->ino->archive->root_entry; } pent = dir; @@ -297,7 +297,7 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, *q = c; return NULL; } - if (!S_ISDIR (pent->inode->st.st_mode)) + if (!S_ISDIR (pent->ino->st.st_mode)) { *q = c; notadir = TRUE; @@ -305,7 +305,7 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, } pdir = pent; - for (pent = pent->inode->first_in_subdir; pent != NULL; pent = pent->next_in_dir) + for (pent = pent->ino->first_in_subdir; pent != NULL; pent = pent->next_in_dir) /* Hack: I keep the original semanthic unless q+1 would break in the strchr */ if (strcmp (pent->name, p) == 0) @@ -313,7 +313,7 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, if (q + 1 > name_end) { *q = c; - notadir = !S_ISDIR (pent->inode->st.st_mode); + notadir = !S_ISDIR (pent->ino->st.st_mode); return pent; } break; @@ -323,9 +323,9 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, * non-existent directories */ if (pent == NULL && make_dirs) - pent = extfs_generate_entry (dir->inode->archive, p, pdir, S_IFDIR | 0777); + pent = extfs_generate_entry (dir->ino->archive, p, pdir, S_IFDIR | 0777); if (pent == NULL && make_file) - pent = extfs_generate_entry (dir->inode->archive, p, pdir, S_IFREG | 0666); + pent = extfs_generate_entry (dir->ino->archive, p, pdir, S_IFREG | 0666); } } /* Next iteration */ @@ -466,7 +466,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) mc_stat (local_name_vpath, ¤t_archive->local_stat); vfs_path_free (local_name_vpath); } - current_archive->inode_counter = 0; + current_archive->ino_usage = 0; current_archive->fd_usage = 0; current_archive->rdev = archive_counter++; first_archive = g_slist_prepend (first_archive, current_archive); @@ -479,11 +479,11 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) mode |= 0001; mode |= S_IFDIR; root_entry = extfs_generate_entry (current_archive, PATH_SEP_STR, NULL, mode); - root_entry->inode->st.st_uid = mystat.st_uid; - root_entry->inode->st.st_gid = mystat.st_gid; - root_entry->inode->st.st_atime = mystat.st_atime; - root_entry->inode->st.st_ctime = mystat.st_ctime; - root_entry->inode->st.st_mtime = mystat.st_mtime; + root_entry->ino->st.st_uid = mystat.st_uid; + root_entry->ino->st.st_gid = mystat.st_gid; + root_entry->ino->st.st_atime = mystat.st_atime; + root_entry->ino->st.st_ctime = mystat.st_ctime; + root_entry->ino->st.st_mtime = mystat.st_mtime; current_archive->root_entry = root_entry; *pparc = current_archive; @@ -563,10 +563,10 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) entry->name = g_strdup (p); entry->next_in_dir = NULL; entry->dir = pent; - if (pent->inode->last_in_subdir) + if (pent->ino->last_in_subdir) { - pent->inode->last_in_subdir->next_in_dir = entry; - pent->inode->last_in_subdir = entry; + pent->ino->last_in_subdir->next_in_dir = entry; + pent->ino->last_in_subdir = entry; } if (!S_ISLNK (hstat.st_mode) && (current_link_name != NULL)) { @@ -581,15 +581,15 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) return -1; } - entry->inode = pent->inode; - pent->inode->st.st_nlink++; + entry->ino = pent->ino; + pent->ino->st.st_nlink++; } else { inode = g_new (struct inode, 1); - entry->inode = inode; - inode->local_filename = NULL; - inode->st.st_ino = current_archive->inode_counter++; + entry->ino = inode; + inode->localname = NULL; + inode->st.st_ino = current_archive->ino_usage++; inode->st.st_nlink = 1; inode->st.st_dev = current_archive->rdev; inode->archive = current_archive; @@ -755,7 +755,7 @@ extfs_resolve_symlinks_int (struct entry *entry, GSList * list) { struct entry *pent = NULL; - if (!S_ISLNK (entry->inode->st.st_mode)) + if (!S_ISLNK (entry->ino->st.st_mode)) return entry; if (g_slist_find (list, entry) != NULL) @@ -768,7 +768,7 @@ extfs_resolve_symlinks_int (struct entry *entry, GSList * list) GSList *looping; looping = g_slist_prepend (list, entry); - pent = extfs_find_entry_int (entry->dir, entry->inode->linkname, looping, FALSE, FALSE); + pent = extfs_find_entry_int (entry->dir, entry->ino->linkname, looping, FALSE, FALSE); looping = g_slist_delete_link (looping, looping); if (pent == NULL) @@ -921,10 +921,10 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) if (entry == NULL) return NULL; - if (S_ISDIR (entry->inode->st.st_mode)) + if (S_ISDIR (entry->ino->st.st_mode)) ERRNOR (EISDIR, NULL); - if (entry->inode->local_filename == NULL) + if (entry->ino->localname == NULL) { vfs_path_t *local_filename_vpath; const char *local_filename; @@ -944,17 +944,17 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) my_errno = EIO; return NULL; } - entry->inode->local_filename = g_strdup (local_filename); + entry->ino->localname = g_strdup (local_filename); vfs_path_free (local_filename_vpath); } - local_handle = open (entry->inode->local_filename, NO_LINEAR (flags), mode); + local_handle = open (entry->ino->localname, NO_LINEAR (flags), mode); if (local_handle == -1) { /* file exists(may be). Need to drop O_CREAT flag and truncate file content */ flags = ~O_CREAT & (NO_LINEAR (flags) | O_TRUNC); - local_handle = open (entry->inode->local_filename, flags, mode); + local_handle = open (entry->ino->localname, flags, mode); } if (local_handle == -1) @@ -963,8 +963,8 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) extfs_info = g_new (struct pseudofile, 1); extfs_info->archive = archive; extfs_info->entry = entry; - extfs_info->has_changed = created; - extfs_info->local_handle = local_handle; + extfs_info->changed = created; + extfs_info->handle = local_handle; /* i.e. we had no open files and now we have one */ vfs_rmstamp (vfs_extfs_ops, (vfsid) archive); @@ -979,7 +979,7 @@ extfs_read (void *data, char *buffer, size_t count) { struct pseudofile *file = (struct pseudofile *) data; - return read (file->local_handle, buffer, count); + return read (file->handle, buffer, count); } /* --------------------------------------------------------------------------------------------- */ @@ -991,22 +991,22 @@ extfs_close (void *data) int errno_code = 0; file = (struct pseudofile *) data; - close (file->local_handle); + close (file->handle); /* Commit the file if it has changed */ - if (file->has_changed) + if (file->changed) { struct stat file_status; - if (extfs_cmd (" copyin ", file->archive, file->entry, file->entry->inode->local_filename)) + if (extfs_cmd (" copyin ", file->archive, file->entry, file->entry->ino->localname)) errno_code = EIO; - if (stat (file->entry->inode->local_filename, &file_status) != 0) + if (stat (file->entry->ino->localname, &file_status) != 0) errno_code = EIO; else - file->entry->inode->st.st_size = file_status.st_size; + file->entry->ino->st.st_size = file_status.st_size; - file->entry->inode->st.st_mtime = time (NULL); + file->entry->ino->st.st_mtime = time (NULL); } if (--file->archive->fd_usage == 0) @@ -1047,12 +1047,12 @@ extfs_opendir (const vfs_path_t * vpath) entry = extfs_resolve_symlinks (entry); if (entry == NULL) return NULL; - if (!S_ISDIR (entry->inode->st.st_mode)) + if (!S_ISDIR (entry->ino->st.st_mode)) ERRNOR (ENOTDIR, NULL); info = g_new (struct entry *, 2); - info[0] = entry->inode->first_in_subdir; - info[1] = entry->inode->first_in_subdir; + info[0] = entry->ino->first_in_subdir; + info[1] = entry->ino->first_in_subdir; return info; } @@ -1122,7 +1122,7 @@ extfs_internal_stat (const vfs_path_t * vpath, struct stat *buf, gboolean resolv if (entry == NULL) goto cleanup; } - extfs_stat_move (buf, entry->inode); + extfs_stat_move (buf, entry->ino); result = 0; cleanup: return result; @@ -1151,7 +1151,7 @@ extfs_fstat (void *data, struct stat *buf) { struct pseudofile *file = (struct pseudofile *) data; - extfs_stat_move (buf, file->entry->inode); + extfs_stat_move (buf, file->entry->ino); return 0; } @@ -1172,7 +1172,7 @@ extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); if (entry == NULL) goto cleanup; - if (!S_ISLNK (entry->inode->st.st_mode)) + if (!S_ISLNK (entry->ino->st.st_mode)) { const vfs_path_element_t *path_element; @@ -1180,12 +1180,12 @@ extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) path_element->class->verrno = EINVAL; goto cleanup; } - len = strlen (entry->inode->linkname); + len = strlen (entry->ino->linkname); if (size < len) len = size; /* readlink() does not append a NUL character to buf */ result = len; - memcpy (buf, entry->inode->linkname, result); + memcpy (buf, entry->ino->linkname, result); cleanup: return result; } @@ -1218,8 +1218,8 @@ extfs_write (void *data, const char *buf, size_t nbyte) { struct pseudofile *file = (struct pseudofile *) data; - file->has_changed = TRUE; - return write (file->local_handle, buf, nbyte); + file->changed = TRUE; + return write (file->handle, buf, nbyte); } /* --------------------------------------------------------------------------------------------- */ @@ -1241,7 +1241,7 @@ extfs_unlink (const vfs_path_t * vpath) entry = extfs_resolve_symlinks (entry); if (entry == NULL) goto cleanup; - if (S_ISDIR (entry->inode->st.st_mode)) + if (S_ISDIR (entry->ino->st.st_mode)) { const vfs_path_element_t *path_element; @@ -1289,7 +1289,7 @@ extfs_mkdir (const vfs_path_t * vpath, mode_t mode) entry = extfs_resolve_symlinks (entry); if (entry == NULL) goto cleanup; - if (!S_ISDIR (entry->inode->st.st_mode)) + if (!S_ISDIR (entry->ino->st.st_mode)) { path_element->class->verrno = ENOTDIR; goto cleanup; @@ -1325,7 +1325,7 @@ extfs_rmdir (const vfs_path_t * vpath) entry = extfs_resolve_symlinks (entry); if (entry == NULL) goto cleanup; - if (!S_ISDIR (entry->inode->st.st_mode)) + if (!S_ISDIR (entry->ino->st.st_mode)) { const vfs_path_element_t *path_element; @@ -1363,7 +1363,7 @@ extfs_chdir (const vfs_path_t * vpath) if (entry == NULL) return -1; entry = extfs_resolve_symlinks (entry); - if ((entry == NULL) || (!S_ISDIR (entry->inode->st.st_mode))) + if ((entry == NULL) || (!S_ISDIR (entry->ino->st.st_mode))) return -1; my_errno = 0; return 0; @@ -1376,7 +1376,7 @@ extfs_lseek (void *data, off_t offset, int whence) { struct pseudofile *file = (struct pseudofile *) data; - return lseek (file->local_handle, offset, whence); + return lseek (file->handle, offset, whence); } /* --------------------------------------------------------------------------------------------- */ @@ -1407,21 +1407,21 @@ extfs_nothingisopen (vfsid id) static void extfs_remove_entry (struct entry *e) { - int i = --e->inode->st.st_nlink; + int i = --e->ino->st.st_nlink; struct entry *pe, *ent, *prev; - if (S_ISDIR (e->inode->st.st_mode) && e->inode->first_in_subdir != NULL) + if (S_ISDIR (e->ino->st.st_mode) && e->ino->first_in_subdir != NULL) { - struct entry *f = e->inode->first_in_subdir; - e->inode->first_in_subdir = NULL; + struct entry *f = e->ino->first_in_subdir; + e->ino->first_in_subdir = NULL; extfs_remove_entry (f); } pe = e->dir; - if (e == pe->inode->first_in_subdir) - pe->inode->first_in_subdir = e->next_in_dir; + if (e == pe->ino->first_in_subdir) + pe->ino->first_in_subdir = e->next_in_dir; prev = NULL; - for (ent = pe->inode->first_in_subdir; ent && ent->next_in_dir; ent = ent->next_in_dir) + for (ent = pe->ino->first_in_subdir; ent && ent->next_in_dir; ent = ent->next_in_dir) if (e == ent->next_in_dir) { prev = ent; @@ -1429,18 +1429,18 @@ extfs_remove_entry (struct entry *e) } if (prev) prev->next_in_dir = e->next_in_dir; - if (e == pe->inode->last_in_subdir) - pe->inode->last_in_subdir = prev; + if (e == pe->ino->last_in_subdir) + pe->ino->last_in_subdir = prev; if (i <= 0) { - if (e->inode->local_filename != NULL) + if (e->ino->localname != NULL) { - unlink (e->inode->local_filename); - g_free (e->inode->local_filename); + unlink (e->ino->localname); + g_free (e->ino->localname); } - g_free (e->inode->linkname); - g_free (e->inode); + g_free (e->ino->linkname); + g_free (e->ino); } g_free (e->name); @@ -1452,24 +1452,24 @@ extfs_remove_entry (struct entry *e) static void extfs_free_entry (struct entry *e) { - int i = --e->inode->st.st_nlink; + int i = --e->ino->st.st_nlink; - if (S_ISDIR (e->inode->st.st_mode) && e->inode->first_in_subdir != NULL) + if (S_ISDIR (e->ino->st.st_mode) && e->ino->first_in_subdir != NULL) { - struct entry *f = e->inode->first_in_subdir; + struct entry *f = e->ino->first_in_subdir; - e->inode->first_in_subdir = NULL; + e->ino->first_in_subdir = NULL; extfs_free_entry (f); } if (i <= 0) { - if (e->inode->local_filename != NULL) + if (e->ino->localname != NULL) { - unlink (e->inode->local_filename); - g_free (e->inode->local_filename); + unlink (e->ino->localname); + g_free (e->ino->localname); } - g_free (e->inode->linkname); - g_free (e->inode); + g_free (e->ino->linkname); + g_free (e->ino); } if (e->next_in_dir != NULL) extfs_free_entry (e->next_in_dir); @@ -1499,12 +1499,12 @@ extfs_getlocalcopy (const vfs_path_t * vpath) fp = (struct pseudofile *) extfs_open (vpath, O_RDONLY, 0); if (fp == NULL) return NULL; - if (fp->entry->inode->local_filename == NULL) + if (fp->entry->ino->localname == NULL) { extfs_close ((void *) fp); return NULL; } - p = vfs_path_from_str (fp->entry->inode->local_filename); + p = vfs_path_from_str (fp->entry->ino->localname); fp->archive->fd_usage++; extfs_close ((void *) fp); return p; @@ -1521,11 +1521,11 @@ extfs_ungetlocalcopy (const vfs_path_t * vpath, const vfs_path_t * local, gboole if (fp == NULL) return 0; - if (strcmp (fp->entry->inode->local_filename, vfs_path_get_last_path_str (local)) == 0) + if (strcmp (fp->entry->ino->localname, vfs_path_get_last_path_str (local)) == 0) { fp->archive->fd_usage--; if (has_changed) - fp->has_changed = TRUE; + fp->changed = TRUE; extfs_close ((void *) fp); return 0; } From c29f068457652945cfa3a31ed1e58ddfc3edebfb Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 15 Mar 2018 14:16:05 +0300 Subject: [PATCH 09/25] extfs: refactoring: rename structures... to unify it with standard VFS ones. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 191 ++++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 89 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 12e6222f6..04e5de7b8 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -74,35 +74,48 @@ #define RECORDSIZE 512 +#define EXTFS_SUPER(a) ((extfs_super_t *) (a)) +#define EXTFS_ENTRY(a) ((extfs_entry_t *) (a)) +#define EXTFS_INODE(a) ((extfs_inode_t *) (a)) + /*** file scope type declarations ****************************************************************/ -struct inode +struct extfs_super_t; +typedef struct extfs_super_t extfs_super_t; + +struct extfs_entry_t; +typedef struct extfs_entry_t extfs_entry_t; + +struct extfs_inode_t; +typedef struct extfs_inode_t extfs_inode_t; + +struct extfs_inode_t { - struct entry *first_in_subdir; /* only used if this is a directory */ - struct entry *last_in_subdir; + extfs_entry_t *first_in_subdir; /* only used if this is a directory */ + extfs_entry_t *last_in_subdir; struct stat st; - struct archive *archive; /* And this is an archive structure */ + extfs_super_t *archive; /* And this is an archive structure */ char *linkname; char *localname; }; -struct entry +struct extfs_entry_t { - struct entry *next_in_dir; - struct entry *dir; + extfs_entry_t *next_in_dir; + extfs_entry_t *dir; char *name; - struct inode *ino; + extfs_inode_t *ino; }; struct pseudofile { - struct archive *archive; + extfs_super_t *archive; gboolean changed; int handle; - struct entry *entry; + extfs_entry_t *entry; }; -struct archive +struct extfs_super_t { int fstype; char *name; @@ -111,7 +124,7 @@ struct archive dev_t rdev; int fd_usage; ino_t ino_usage; - struct entry *root_entry; + extfs_entry_t *root_entry; }; typedef struct @@ -138,17 +151,17 @@ static int my_errno = 0; /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ -static void extfs_remove_entry (struct entry *e); +static void extfs_remove_entry (extfs_entry_t * e); static void extfs_free (vfsid id); -static void extfs_free_entry (struct entry *e); -static struct entry *extfs_resolve_symlinks_int (struct entry *entry, GSList * list); +static void extfs_free_entry (extfs_entry_t * e); +static extfs_entry_t *extfs_resolve_symlinks_int (extfs_entry_t * entry, GSList * list); /* --------------------------------------------------------------------------------------------- */ static void extfs_fill_name (void *data, void *user_data) { - struct archive *a = (struct archive *) data; + extfs_super_t *a = EXTFS_SUPER (data); fill_names_f func = (fill_names_f) user_data; extfs_plugin_info_t *info; char *name; @@ -166,7 +179,7 @@ extfs_fill_name (void *data, void *user_data) static gint extfs_cmp_archive (const void *a, const void *b) { - const struct archive *ar = (const struct archive *) a; + const extfs_super_t *ar = (const extfs_super_t *) a; const char *archive_name = (const char *) b; return (ar->name != NULL && strcmp (ar->name, archive_name) == 0) ? 0 : 1; @@ -175,11 +188,11 @@ extfs_cmp_archive (const void *a, const void *b) /* --------------------------------------------------------------------------------------------- */ static void -extfs_make_dots (struct entry *ent) +extfs_make_dots (extfs_entry_t * ent) { - struct entry *entry = g_new (struct entry, 1); - struct entry *parentry = ent->dir; - struct inode *inode = ent->ino, *parent; + extfs_entry_t *entry = g_new (extfs_entry_t, 1); + extfs_entry_t *parentry = ent->dir; + extfs_inode_t *inode = ent->ino, *parent; parent = (parentry != NULL) ? parentry->ino : NULL; entry->name = g_strdup ("."); @@ -189,7 +202,7 @@ extfs_make_dots (struct entry *ent) inode->first_in_subdir = entry; inode->st.st_nlink++; - entry->next_in_dir = g_new (struct entry, 1); + entry->next_in_dir = g_new (extfs_entry_t, 1); entry = entry->next_in_dir; entry->name = g_strdup (".."); inode->last_in_subdir = entry; @@ -210,16 +223,16 @@ extfs_make_dots (struct entry *ent) /* --------------------------------------------------------------------------------------------- */ -static struct entry * -extfs_generate_entry (struct archive *archive, - const char *name, struct entry *parentry, mode_t mode) +static extfs_entry_t * +extfs_generate_entry (extfs_super_t * archive, + const char *name, extfs_entry_t * parentry, mode_t mode) { mode_t myumask; - struct inode *inode, *parent; - struct entry *entry; + extfs_inode_t *inode, *parent; + extfs_entry_t *entry; parent = (parentry != NULL) ? parentry->ino : NULL; - entry = g_new (struct entry, 1); + entry = g_new (extfs_entry_t, 1); entry->name = g_strdup (name); entry->next_in_dir = NULL; @@ -229,7 +242,7 @@ extfs_generate_entry (struct archive *archive, parent->last_in_subdir->next_in_dir = entry; parent->last_in_subdir = entry; } - inode = g_new (struct inode, 1); + inode = g_new (extfs_inode_t, 1); entry->ino = inode; inode->localname = NULL; inode->linkname = NULL; @@ -256,11 +269,11 @@ extfs_generate_entry (struct archive *archive, /* --------------------------------------------------------------------------------------------- */ -static struct entry * -extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, +static extfs_entry_t * +extfs_find_entry_int (extfs_entry_t * dir, const char *name, GSList * list, gboolean make_dirs, gboolean make_file) { - struct entry *pent, *pdir; + extfs_entry_t *pent, *pdir; const char *p, *name_end; char *q; char c = PATH_SEP; @@ -344,10 +357,10 @@ extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, /* --------------------------------------------------------------------------------------------- */ -static struct entry * -extfs_find_entry (struct entry *dir, const char *name, gboolean make_dirs, gboolean make_file) +static extfs_entry_t * +extfs_find_entry (extfs_entry_t * dir, const char *name, gboolean make_dirs, gboolean make_file) { - struct entry *res; + extfs_entry_t *res; errloop = FALSE; notadir = FALSE; @@ -376,7 +389,7 @@ extfs_fill_names (struct vfs_class *me, fill_names_f func) /* --------------------------------------------------------------------------------------------- */ static void -extfs_free_archive (struct archive *archive) +extfs_free_archive (extfs_super_t * archive) { extfs_free_entry (archive->root_entry); @@ -401,7 +414,7 @@ extfs_free_archive (struct archive *archive) /* --------------------------------------------------------------------------------------------- */ static FILE * -extfs_open_archive (int fstype, const char *name, struct archive **pparc) +extfs_open_archive (int fstype, const char *name, extfs_super_t ** pparc) { const extfs_plugin_info_t *info; static dev_t archive_counter = 0; @@ -409,8 +422,8 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) mode_t mode; char *cmd; struct stat mystat; - struct archive *current_archive; - struct entry *root_entry; + extfs_super_t *current_archive; + extfs_entry_t *root_entry; char *tmp = NULL; vfs_path_t *local_name_vpath = NULL; vfs_path_t *name_vpath; @@ -456,7 +469,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) setvbuf (result, NULL, _IONBF, 0); #endif - current_archive = g_new (struct archive, 1); + current_archive = g_new (extfs_super_t, 1); current_archive->fstype = fstype; current_archive->name = g_strdup (name); current_archive->local_name = g_strdup (vfs_path_get_last_path_str (local_name_vpath)); @@ -500,12 +513,12 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) */ static int -extfs_read_archive (int fstype, const char *name, struct archive **pparc) +extfs_read_archive (int fstype, const char *name, extfs_super_t ** pparc) { FILE *extfsd; const extfs_plugin_info_t *info; char *buffer; - struct archive *current_archive; + extfs_super_t *current_archive; char *current_file_name, *current_link_name; info = &g_array_index (extfs_plugins, extfs_plugin_info_t, fstype); @@ -526,8 +539,8 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) current_link_name = NULL; if (vfs_parse_ls_lga (buffer, &hstat, ¤t_file_name, ¤t_link_name, NULL)) { - struct entry *entry, *pent; - struct inode *inode; + extfs_entry_t *entry, *pent; + extfs_inode_t *inode; char *p, *q, *cfn = current_file_name; if (*cfn != '\0') @@ -559,7 +572,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) close_error_pipe (D_ERROR, _("Inconsistent extfs archive")); return -1; } - entry = g_new (struct entry, 1); + entry = g_new (extfs_entry_t, 1); entry->name = g_strdup (p); entry->next_in_dir = NULL; entry->dir = pent; @@ -586,7 +599,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) } else { - inode = g_new (struct inode, 1); + inode = g_new (extfs_inode_t, 1); entry->ino = inode; inode->localname = NULL; inode->st.st_ino = current_archive->ino_usage++; @@ -672,14 +685,14 @@ extfs_which (struct vfs_class *me, const char *path) * Dissect the path and create corresponding superblock. */ static const char * -extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean do_not_open) +extfs_get_path_int (const vfs_path_t * vpath, extfs_super_t ** archive, gboolean do_not_open) { char *archive_name; int result = -1; GSList *parc; int fstype; const vfs_path_element_t *path_element; - struct archive *a = NULL; + extfs_super_t *a = NULL; path_element = vfs_path_get_by_index (vpath, -1); @@ -696,7 +709,7 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean parc = g_slist_find_custom (first_archive, archive_name, extfs_cmp_archive); if (parc != NULL) { - a = (struct archive *) parc->data; + a = EXTFS_SUPER (parc->data); vfs_stamp (vfs_extfs_ops, (vfsid) a); g_free (archive_name); goto return_success; @@ -722,7 +735,7 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean */ static char * -extfs_get_path (const vfs_path_t * vpath, struct archive **archive, gboolean do_not_open) +extfs_get_path (const vfs_path_t * vpath, extfs_super_t ** archive, gboolean do_not_open) { return g_strdup (extfs_get_path_int (vpath, archive, do_not_open)); } @@ -731,7 +744,7 @@ extfs_get_path (const vfs_path_t * vpath, struct archive **archive, gboolean do_ /* Return allocated path (without leading slash) inside the archive */ static char * -extfs_get_path_from_entry (struct entry *entry) +extfs_get_path_from_entry (extfs_entry_t * entry) { GString *localpath; @@ -750,10 +763,10 @@ extfs_get_path_from_entry (struct entry *entry) /* --------------------------------------------------------------------------------------------- */ -static struct entry * -extfs_resolve_symlinks_int (struct entry *entry, GSList * list) +static extfs_entry_t * +extfs_resolve_symlinks_int (extfs_entry_t * entry, GSList * list) { - struct entry *pent = NULL; + extfs_entry_t *pent = NULL; if (!S_ISLNK (entry->ino->st.st_mode)) return entry; @@ -780,10 +793,10 @@ extfs_resolve_symlinks_int (struct entry *entry, GSList * list) /* --------------------------------------------------------------------------------------------- */ -static struct entry * -extfs_resolve_symlinks (struct entry *entry) +static extfs_entry_t * +extfs_resolve_symlinks (extfs_entry_t * entry) { - struct entry *res; + extfs_entry_t *res; errloop = FALSE; notadir = FALSE; @@ -801,7 +814,7 @@ extfs_resolve_symlinks (struct entry *entry) /* --------------------------------------------------------------------------------------------- */ static char * -extfs_get_archive_name (struct archive *archive) +extfs_get_archive_name (extfs_super_t * archive) { const char *archive_name; @@ -830,8 +843,8 @@ extfs_get_archive_name (struct archive *archive) /** Don't pass localname as NULL */ static int -extfs_cmd (const char *str_extfs_cmd, struct archive *archive, - struct entry *entry, const char *localname) +extfs_cmd (const char *str_extfs_cmd, extfs_super_t * archive, + extfs_entry_t * entry, const char *localname) { char *file; char *quoted_file; @@ -868,7 +881,7 @@ extfs_cmd (const char *str_extfs_cmd, struct archive *archive, static void extfs_run (const vfs_path_t * vpath) { - struct archive *archive = NULL; + extfs_super_t *archive = NULL; char *p, *q, *archive_name, *quoted_archive_name; char *cmd; const extfs_plugin_info_t *info; @@ -897,9 +910,9 @@ static void * extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) { struct pseudofile *extfs_info; - struct archive *archive = NULL; + extfs_super_t *archive = NULL; char *q; - struct entry *entry; + extfs_entry_t *entry; int local_handle; gboolean created = FALSE; @@ -1032,10 +1045,10 @@ extfs_errno (struct vfs_class *me) static void * extfs_opendir (const vfs_path_t * vpath) { - struct archive *archive = NULL; + extfs_super_t *archive = NULL; char *q; - struct entry *entry; - struct entry **info; + extfs_entry_t *entry; + extfs_entry_t **info; q = extfs_get_path (vpath, &archive, FALSE); if (q == NULL) @@ -1050,7 +1063,7 @@ extfs_opendir (const vfs_path_t * vpath) if (!S_ISDIR (entry->ino->st.st_mode)) ERRNOR (ENOTDIR, NULL); - info = g_new (struct entry *, 2); + info = g_new (extfs_entry_t *, 2); info[0] = entry->ino->first_in_subdir; info[1] = entry->ino->first_in_subdir; @@ -1063,7 +1076,7 @@ static void * extfs_readdir (void *data) { static union vfs_dirent dir; - struct entry **info = (struct entry **) data; + extfs_entry_t **info = (extfs_entry_t **) data; if (*info == NULL) return NULL; @@ -1087,7 +1100,7 @@ extfs_closedir (void *data) /* --------------------------------------------------------------------------------------------- */ static void -extfs_stat_move (struct stat *buf, const struct inode *inode) +extfs_stat_move (struct stat *buf, const extfs_inode_t * inode) { *buf = inode->st; @@ -1105,9 +1118,9 @@ extfs_stat_move (struct stat *buf, const struct inode *inode) static int extfs_internal_stat (const vfs_path_t * vpath, struct stat *buf, gboolean resolve) { - struct archive *archive; + extfs_super_t *archive; const char *q; - struct entry *entry; + extfs_entry_t *entry; int result = -1; q = extfs_get_path_int (vpath, &archive, FALSE); @@ -1160,10 +1173,10 @@ extfs_fstat (void *data, struct stat *buf) static int extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) { - struct archive *archive; + extfs_super_t *archive; const char *q; size_t len; - struct entry *entry; + extfs_entry_t *entry; int result = -1; q = extfs_get_path_int (vpath, &archive, FALSE); @@ -1227,9 +1240,9 @@ extfs_write (void *data, const char *buf, size_t nbyte) static int extfs_unlink (const vfs_path_t * vpath) { - struct archive *archive; + extfs_super_t *archive; const char *q; - struct entry *entry; + extfs_entry_t *entry; int result = -1; q = extfs_get_path_int (vpath, &archive, FALSE); @@ -1265,9 +1278,9 @@ extfs_unlink (const vfs_path_t * vpath) static int extfs_mkdir (const vfs_path_t * vpath, mode_t mode) { - struct archive *archive; + extfs_super_t *archive; const char *q; - struct entry *entry; + extfs_entry_t *entry; int result = -1; const vfs_path_element_t *path_element; @@ -1311,9 +1324,9 @@ extfs_mkdir (const vfs_path_t * vpath, mode_t mode) static int extfs_rmdir (const vfs_path_t * vpath) { - struct archive *archive; + extfs_super_t *archive; const char *q; - struct entry *entry; + extfs_entry_t *entry; int result = -1; q = extfs_get_path_int (vpath, &archive, FALSE); @@ -1350,9 +1363,9 @@ extfs_rmdir (const vfs_path_t * vpath) static int extfs_chdir (const vfs_path_t * vpath) { - struct archive *archive = NULL; + extfs_super_t *archive = NULL; char *q; - struct entry *entry; + extfs_entry_t *entry; my_errno = ENOTDIR; q = extfs_get_path (vpath, &archive, FALSE); @@ -1384,7 +1397,7 @@ extfs_lseek (void *data, off_t offset, int whence) static vfsid extfs_getid (const vfs_path_t * vpath) { - struct archive *archive = NULL; + extfs_super_t *archive = NULL; char *p; p = extfs_get_path (vpath, &archive, TRUE); @@ -1399,20 +1412,20 @@ extfs_getid (const vfs_path_t * vpath) static int extfs_nothingisopen (vfsid id) { - return (((struct archive *) id)->fd_usage <= 0); + return (EXTFS_SUPER (id)->fd_usage <= 0); } /* --------------------------------------------------------------------------------------------- */ static void -extfs_remove_entry (struct entry *e) +extfs_remove_entry (extfs_entry_t * e) { int i = --e->ino->st.st_nlink; - struct entry *pe, *ent, *prev; + extfs_entry_t *pe, *ent, *prev; if (S_ISDIR (e->ino->st.st_mode) && e->ino->first_in_subdir != NULL) { - struct entry *f = e->ino->first_in_subdir; + extfs_entry_t *f = e->ino->first_in_subdir; e->ino->first_in_subdir = NULL; extfs_remove_entry (f); } @@ -1450,13 +1463,13 @@ extfs_remove_entry (struct entry *e) /* --------------------------------------------------------------------------------------------- */ static void -extfs_free_entry (struct entry *e) +extfs_free_entry (extfs_entry_t * e) { int i = --e->ino->st.st_nlink; if (S_ISDIR (e->ino->st.st_mode) && e->ino->first_in_subdir != NULL) { - struct entry *f = e->ino->first_in_subdir; + extfs_entry_t *f = e->ino->first_in_subdir; e->ino->first_in_subdir = NULL; extfs_free_entry (f); @@ -1482,7 +1495,7 @@ extfs_free_entry (struct entry *e) static void extfs_free (vfsid id) { - struct archive *archive = (struct archive *) id; + extfs_super_t *archive = EXTFS_SUPER (id); first_archive = g_slist_remove (first_archive, archive); extfs_free_archive (archive); From 01a00e7ce6ca04d9df7d90dfb72779ee7a817d69 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 13 Mar 2018 14:24:39 +0300 Subject: [PATCH 10/25] extfs: constify some function arguments. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 04e5de7b8..3c5ce90fe 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -744,7 +744,7 @@ extfs_get_path (const vfs_path_t * vpath, extfs_super_t ** archive, gboolean do_ /* Return allocated path (without leading slash) inside the archive */ static char * -extfs_get_path_from_entry (extfs_entry_t * entry) +extfs_get_path_from_entry (const extfs_entry_t * entry) { GString *localpath; @@ -814,7 +814,7 @@ extfs_resolve_symlinks (extfs_entry_t * entry) /* --------------------------------------------------------------------------------------------- */ static char * -extfs_get_archive_name (extfs_super_t * archive) +extfs_get_archive_name (const extfs_super_t * archive) { const char *archive_name; @@ -843,8 +843,8 @@ extfs_get_archive_name (extfs_super_t * archive) /** Don't pass localname as NULL */ static int -extfs_cmd (const char *str_extfs_cmd, extfs_super_t * archive, - extfs_entry_t * entry, const char *localname) +extfs_cmd (const char *str_extfs_cmd, const extfs_super_t * archive, + const extfs_entry_t * entry, const char *localname) { char *file; char *quoted_file; From a91323f7ac823fde9c0615ab4cc98fb29b1b339b Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 5 Jun 2018 10:52:28 +0300 Subject: [PATCH 11/25] (extfs_find_entry): use standard VFS flags. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 3c5ce90fe..5ca5b1a02 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -270,8 +270,7 @@ extfs_generate_entry (extfs_super_t * archive, /* --------------------------------------------------------------------------------------------- */ static extfs_entry_t * -extfs_find_entry_int (extfs_entry_t * dir, const char *name, GSList * list, - gboolean make_dirs, gboolean make_file) +extfs_find_entry_int (extfs_entry_t * dir, const char *name, GSList * list, int flags) { extfs_entry_t *pent, *pdir; const char *p, *name_end; @@ -335,9 +334,9 @@ extfs_find_entry_int (extfs_entry_t * dir, const char *name, GSList * list, /* When we load archive, we create automagically * non-existent directories */ - if (pent == NULL && make_dirs) + if (pent == NULL && (flags & FL_MKDIR) != 0) pent = extfs_generate_entry (dir->ino->archive, p, pdir, S_IFDIR | 0777); - if (pent == NULL && make_file) + if (pent == NULL && (flags & FL_MKFILE) != 0) pent = extfs_generate_entry (dir->ino->archive, p, pdir, S_IFREG | 0666); } } @@ -358,14 +357,14 @@ extfs_find_entry_int (extfs_entry_t * dir, const char *name, GSList * list, /* --------------------------------------------------------------------------------------------- */ static extfs_entry_t * -extfs_find_entry (extfs_entry_t * dir, const char *name, gboolean make_dirs, gboolean make_file) +extfs_find_entry (extfs_entry_t * dir, const char *name, int flags) { extfs_entry_t *res; errloop = FALSE; notadir = FALSE; - res = extfs_find_entry_int (dir, name, NULL, make_dirs, make_file); + res = extfs_find_entry_int (dir, name, NULL, flags); if (res == NULL) { if (errloop) @@ -563,7 +562,7 @@ extfs_read_archive (int fstype, const char *name, extfs_super_t ** pparc) } if (S_ISDIR (hstat.st_mode) && (DIR_IS_DOT (p) || DIR_IS_DOTDOT (p))) goto read_extfs_continue; - pent = extfs_find_entry (current_archive->root_entry, q, TRUE, FALSE); + pent = extfs_find_entry (current_archive->root_entry, q, FL_MKDIR); if (pent == NULL) { /* FIXME: Should clean everything one day */ @@ -583,8 +582,8 @@ extfs_read_archive (int fstype, const char *name, extfs_super_t ** pparc) } if (!S_ISLNK (hstat.st_mode) && (current_link_name != NULL)) { - pent = extfs_find_entry (current_archive->root_entry, - current_link_name, FALSE, FALSE); + pent = + extfs_find_entry (current_archive->root_entry, current_link_name, FL_NONE); if (pent == NULL) { /* FIXME: Should clean everything one day */ @@ -781,7 +780,7 @@ extfs_resolve_symlinks_int (extfs_entry_t * entry, GSList * list) GSList *looping; looping = g_slist_prepend (list, entry); - pent = extfs_find_entry_int (entry->dir, entry->ino->linkname, looping, FALSE, FALSE); + pent = extfs_find_entry_int (entry->dir, entry->ino->linkname, looping, FL_NONE); looping = g_slist_delete_link (looping, looping); if (pent == NULL) @@ -919,11 +918,11 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) q = extfs_get_path (vpath, &archive, FALSE); if (q == NULL) return NULL; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); if ((entry == NULL) && ((flags & O_CREAT) != 0)) { /* Create new entry */ - entry = extfs_find_entry (archive->root_entry, q, FALSE, TRUE); + entry = extfs_find_entry (archive->root_entry, q, FL_MKFILE); created = (entry != NULL); } @@ -1053,7 +1052,7 @@ extfs_opendir (const vfs_path_t * vpath) q = extfs_get_path (vpath, &archive, FALSE); if (q == NULL) return NULL; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); g_free (q); if (entry == NULL) return NULL; @@ -1126,7 +1125,7 @@ extfs_internal_stat (const vfs_path_t * vpath, struct stat *buf, gboolean resolv q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); if (entry == NULL) goto cleanup; if (resolve) @@ -1182,7 +1181,7 @@ extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); if (entry == NULL) goto cleanup; if (!S_ISLNK (entry->ino->st.st_mode)) @@ -1248,7 +1247,7 @@ extfs_unlink (const vfs_path_t * vpath) q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); if (entry == NULL) goto cleanup; entry = extfs_resolve_symlinks (entry); @@ -1290,13 +1289,13 @@ extfs_mkdir (const vfs_path_t * vpath, mode_t mode) q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); if (entry != NULL) { path_element->class->verrno = EEXIST; goto cleanup; } - entry = extfs_find_entry (archive->root_entry, q, TRUE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_MKDIR); if (entry == NULL) goto cleanup; entry = extfs_resolve_symlinks (entry); @@ -1332,7 +1331,7 @@ extfs_rmdir (const vfs_path_t * vpath) q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); if (entry == NULL) goto cleanup; entry = extfs_resolve_symlinks (entry); @@ -1371,7 +1370,7 @@ extfs_chdir (const vfs_path_t * vpath) q = extfs_get_path (vpath, &archive, FALSE); if (q == NULL) return -1; - entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); + entry = extfs_find_entry (archive->root_entry, q, FL_NONE); g_free (q); if (entry == NULL) return -1; From 42469e201650f7fb2dabc646ea2e7a06aef5d9a8 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 6 Jun 2018 16:27:54 +0300 Subject: [PATCH 12/25] (extfs_get_path): use standard VFS flags. --- src/vfs/extfs/extfs.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 5ca5b1a02..5b351860f 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -684,7 +684,7 @@ extfs_which (struct vfs_class *me, const char *path) * Dissect the path and create corresponding superblock. */ static const char * -extfs_get_path_int (const vfs_path_t * vpath, extfs_super_t ** archive, gboolean do_not_open) +extfs_get_path_int (const vfs_path_t * vpath, extfs_super_t ** archive, int flags) { char *archive_name; int result = -1; @@ -714,7 +714,7 @@ extfs_get_path_int (const vfs_path_t * vpath, extfs_super_t ** archive, gboolean goto return_success; } - result = do_not_open ? -1 : extfs_read_archive (fstype, archive_name, &a); + result = (flags & FL_NO_OPEN) != 0 ? -1 : extfs_read_archive (fstype, archive_name, &a); g_free (archive_name); if (result == -1) { @@ -734,9 +734,9 @@ extfs_get_path_int (const vfs_path_t * vpath, extfs_super_t ** archive, gboolean */ static char * -extfs_get_path (const vfs_path_t * vpath, extfs_super_t ** archive, gboolean do_not_open) +extfs_get_path (const vfs_path_t * vpath, extfs_super_t ** archive, int flags) { - return g_strdup (extfs_get_path_int (vpath, archive, do_not_open)); + return g_strdup (extfs_get_path_int (vpath, archive, flags)); } /* --------------------------------------------------------------------------------------------- */ @@ -885,7 +885,7 @@ extfs_run (const vfs_path_t * vpath) char *cmd; const extfs_plugin_info_t *info; - p = extfs_get_path (vpath, &archive, FALSE); + p = extfs_get_path (vpath, &archive, FL_NONE); if (p == NULL) return; q = name_quote (p, FALSE); @@ -915,7 +915,7 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) int local_handle; gboolean created = FALSE; - q = extfs_get_path (vpath, &archive, FALSE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) return NULL; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1049,7 +1049,7 @@ extfs_opendir (const vfs_path_t * vpath) extfs_entry_t *entry; extfs_entry_t **info; - q = extfs_get_path (vpath, &archive, FALSE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) return NULL; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1122,7 +1122,7 @@ extfs_internal_stat (const vfs_path_t * vpath, struct stat *buf, gboolean resolv extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1178,7 +1178,7 @@ extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1244,7 +1244,7 @@ extfs_unlink (const vfs_path_t * vpath) extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1286,7 +1286,7 @@ extfs_mkdir (const vfs_path_t * vpath, mode_t mode) (void) mode; path_element = vfs_path_get_by_index (vpath, -1); - q = extfs_get_path_int (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1328,7 +1328,7 @@ extfs_rmdir (const vfs_path_t * vpath) extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1367,7 +1367,7 @@ extfs_chdir (const vfs_path_t * vpath) extfs_entry_t *entry; my_errno = ENOTDIR; - q = extfs_get_path (vpath, &archive, FALSE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) return -1; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1399,7 +1399,7 @@ extfs_getid (const vfs_path_t * vpath) extfs_super_t *archive = NULL; char *p; - p = extfs_get_path (vpath, &archive, TRUE); + p = extfs_get_path (vpath, &archive, FL_NO_OPEN); if (p == NULL) return NULL; g_free (p); From eb507862ff8cdbe7ff7fc2ddf33bef58c9af66ed Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 1 Jul 2018 10:15:09 +0300 Subject: [PATCH 13/25] (str_ptr_array_join): constify argument. Signed-off-by: Andrew Borodin --- lib/strutil/replace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/strutil/replace.c b/lib/strutil/replace.c index 4c2bab991..8b204c272 100644 --- a/lib/strutil/replace.c +++ b/lib/strutil/replace.c @@ -42,7 +42,7 @@ /* --------------------------------------------------------------------------------------------- */ static char * -str_ptr_array_join (GPtrArray * str_splints) +str_ptr_array_join (const GPtrArray * str_splints) { GString *return_str; guint i; From 0af1c270e2aea1841dc875db844d4d9424752fc8 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 1 Jul 2018 10:16:08 +0300 Subject: [PATCH 14/25] (file_mask_dialog): grammar. Signed-off-by: Andrew Borodin --- src/filemanager/filegui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c index 8c4fcc030..dbbc8b7b1 100644 --- a/src/filemanager/filegui.c +++ b/src/filemanager/filegui.c @@ -1180,7 +1180,7 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation, if (ctx == NULL) return NULL; - /* unselect checkbox if target filesystem don't support attributes */ + /* unselect checkbox if target filesystem doesn't support attributes */ ctx->op_preserve = filegui__check_attrs_on_fs (def_text); ctx->stable_symlinks = FALSE; *do_bg = FALSE; From 32687c9c4ecf8a140ffcb8c3f102de66348d08a9 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 1 Jul 2018 10:45:47 +0300 Subject: [PATCH 15/25] (file_mask_dialog): don't return an empty string. Signed-off-by: Andrew Borodin --- src/filemanager/file.c | 3 --- src/filemanager/filegui.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 6683fbeed..937d43d77 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -1821,9 +1821,6 @@ do_confirm_copy_move (const WPanel * panel, FileOperation operation, gboolean fo g_free (format); g_free (dest_dir); - if (ret == NULL || ret[0] == '\0') - MC_PTR_FREE (ret); - return ret; } diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c index dbbc8b7b1..7c8108fa0 100644 --- a/src/filemanager/filegui.c +++ b/src/filemanager/filegui.c @@ -1300,7 +1300,8 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation, { g_free (def_text_secure); g_free (source_mask); - return dest_dir; + g_free (dest_dir); + return NULL; } ctx->search_handle = mc_search_new (source_mask, NULL); From 8cbb9cd1ac5551021ed56be901f94f508a3a9c36 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 19 Jul 2018 14:23:57 +0300 Subject: [PATCH 16/25] extfs: optimization: get rid of extra memory duplication. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 44 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 5b351860f..861e86854 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -684,7 +684,7 @@ extfs_which (struct vfs_class *me, const char *path) * Dissect the path and create corresponding superblock. */ static const char * -extfs_get_path_int (const vfs_path_t * vpath, extfs_super_t ** archive, int flags) +extfs_get_path (const vfs_path_t * vpath, extfs_super_t ** archive, int flags) { char *archive_name; int result = -1; @@ -727,18 +727,6 @@ extfs_get_path_int (const vfs_path_t * vpath, extfs_super_t ** archive, int flag return path_element->path; } -/* --------------------------------------------------------------------------------------------- */ -/** - * Dissect the path and create corresponding superblock. - * The result should be freed. - */ - -static char * -extfs_get_path (const vfs_path_t * vpath, extfs_super_t ** archive, int flags) -{ - return g_strdup (extfs_get_path_int (vpath, archive, flags)); -} - /* --------------------------------------------------------------------------------------------- */ /* Return allocated path (without leading slash) inside the archive */ @@ -881,7 +869,8 @@ static void extfs_run (const vfs_path_t * vpath) { extfs_super_t *archive = NULL; - char *p, *q, *archive_name, *quoted_archive_name; + const char *p; + char *q, *archive_name, *quoted_archive_name; char *cmd; const extfs_plugin_info_t *info; @@ -889,7 +878,6 @@ extfs_run (const vfs_path_t * vpath) if (p == NULL) return; q = name_quote (p, FALSE); - g_free (p); archive_name = extfs_get_archive_name (archive); quoted_archive_name = name_quote (archive_name, FALSE); @@ -910,7 +898,7 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) { struct pseudofile *extfs_info; extfs_super_t *archive = NULL; - char *q; + const char *q; extfs_entry_t *entry; int local_handle; gboolean created = FALSE; @@ -926,7 +914,6 @@ extfs_open (const vfs_path_t * vpath, int flags, mode_t mode) created = (entry != NULL); } - g_free (q); if (entry == NULL) return NULL; entry = extfs_resolve_symlinks (entry); @@ -1045,7 +1032,7 @@ static void * extfs_opendir (const vfs_path_t * vpath) { extfs_super_t *archive = NULL; - char *q; + const char *q; extfs_entry_t *entry; extfs_entry_t **info; @@ -1053,7 +1040,6 @@ extfs_opendir (const vfs_path_t * vpath) if (q == NULL) return NULL; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); - g_free (q); if (entry == NULL) return NULL; entry = extfs_resolve_symlinks (entry); @@ -1122,7 +1108,7 @@ extfs_internal_stat (const vfs_path_t * vpath, struct stat *buf, gboolean resolv extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FL_NONE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1178,7 +1164,7 @@ extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FL_NONE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1244,7 +1230,7 @@ extfs_unlink (const vfs_path_t * vpath) extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FL_NONE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1286,7 +1272,7 @@ extfs_mkdir (const vfs_path_t * vpath, mode_t mode) (void) mode; path_element = vfs_path_get_by_index (vpath, -1); - q = extfs_get_path_int (vpath, &archive, FL_NONE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1328,7 +1314,7 @@ extfs_rmdir (const vfs_path_t * vpath) extfs_entry_t *entry; int result = -1; - q = extfs_get_path_int (vpath, &archive, FL_NONE); + q = extfs_get_path (vpath, &archive, FL_NONE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); @@ -1363,7 +1349,7 @@ static int extfs_chdir (const vfs_path_t * vpath) { extfs_super_t *archive = NULL; - char *q; + const char *q; extfs_entry_t *entry; my_errno = ENOTDIR; @@ -1371,7 +1357,6 @@ extfs_chdir (const vfs_path_t * vpath) if (q == NULL) return -1; entry = extfs_find_entry (archive->root_entry, q, FL_NONE); - g_free (q); if (entry == NULL) return -1; entry = extfs_resolve_symlinks (entry); @@ -1397,13 +1382,10 @@ static vfsid extfs_getid (const vfs_path_t * vpath) { extfs_super_t *archive = NULL; - char *p; + const char *p; p = extfs_get_path (vpath, &archive, FL_NO_OPEN); - if (p == NULL) - return NULL; - g_free (p); - return (vfsid) archive; + return (p == NULL ? NULL : (vfsid) archive); } /* --------------------------------------------------------------------------------------------- */ From b684ce256584b2644f575ed2636d4ab7d38bc245 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 22 Jul 2018 17:20:27 +0300 Subject: [PATCH 17/25] Clarify usage of FL_NONE value. Signed-off-by: Andrew Borodin --- lib/vfs/direntry.c | 2 +- lib/vfs/xdirentry.h | 2 +- src/vfs/tar/tar.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 234d96396..607642e87 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -164,7 +164,7 @@ vfs_s_resolve_symlink (struct vfs_class *me, struct vfs_s_entry *entry, int foll } } - target = MEDATA->find_entry (me, entry->dir->super->root, linkname, follow - 1, 0); + target = MEDATA->find_entry (me, entry->dir->super->root, linkname, follow - 1, FL_NONE); g_free (fullname); return target; } diff --git a/lib/vfs/xdirentry.h b/lib/vfs/xdirentry.h index f51ddd040..b0cb7b0d4 100644 --- a/lib/vfs/xdirentry.h +++ b/lib/vfs/xdirentry.h @@ -19,7 +19,7 @@ #define LINK_FOLLOW 15 #define LINK_NO_FOLLOW -1 -/* For vfs_s_find_entry */ +/* For vfs_s_find_entry and vfs_s_find_inode */ #define FL_NONE 0 #define FL_MKDIR 1 #define FL_MKFILE 2 diff --git a/src/vfs/tar/tar.c b/src/vfs/tar/tar.c index be7531053..2143c6f80 100644 --- a/src/vfs/tar/tar.c +++ b/src/vfs/tar/tar.c @@ -733,7 +733,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive, int tard, si if (header->header.linkflag == LF_LINK) { - inode = vfs_s_find_inode (me, archive, current_link_name, LINK_NO_FOLLOW, 0); + inode = vfs_s_find_inode (me, archive, current_link_name, LINK_NO_FOLLOW, FL_NONE); if (inode == NULL) { message (D_ERROR, MSG_ERROR, _("Inconsistent tar archive")); From 92419cf7971567c57e398337b0cd99cc91209575 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 30 Jul 2018 11:24:59 +0300 Subject: [PATCH 18/25] doc: clarify description of system-wide confiduration files. --- doc/man/mc.1.in | 20 +++++++++++++------- doc/man/ru/mc.1.in | 11 +++++++---- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/doc/man/mc.1.in b/doc/man/mc.1.in index 3303eff7e..89f3d6294 100644 --- a/doc/man/mc.1.in +++ b/doc/man/mc.1.in @@ -2288,11 +2288,13 @@ connection is initiated by the server. This may not work with some firewalls. .\"NODE " Save Setup" .SH " Save Setup" -At startup, Midnight Commander will try to load initialization -information from the ~/.config/mc/ini file. If this file -doesn't exist, it will load the information from the system\-wide -configuration file, located in %prefix%/share/mc/mc.ini. If the -system\-wide configuration file doesn't exist, MC uses the default settings. +At startup, Midnight Commander tries to load initialization information +from the ~/.config/mc/ini file. +If this file doesn't exist, the system\-wide file +.B %sysconfdir%/mc/mc.ini +is used. If this file doesn't exist, the system\-wide file +.B %prefix%/share/mc/mc.ini +is used. If this file doesn't exist, MC uses the default settings. .PP The .I Save Setup @@ -4311,10 +4313,14 @@ The default system\-wide extensions file. User's own extension, view configuration and edit configuration file. They override the contents of the system wide files if present. .PP +.I %sysconfdir%/mc/mc.ini +.RE .I %prefix%/share/mc/mc.ini .IP -The default system\-wide setup for Midnight Commander, used only if -the user doesn't have his own ~/.config/mc/ini file. +System\-wide setup files for Midnight Commander, used only if the user +doesn't have his own +.B ~/.config/mc/ini +file. If %sysconfdir%/mc/mc.ini exists, %prefix%/share/mc/mc.ini isn't used. .PP .I %prefix%/share/mc/mc.lib .IP diff --git a/doc/man/ru/mc.1.in b/doc/man/ru/mc.1.in index f59bd8629..1fa913e21 100644 --- a/doc/man/ru/mc.1.in +++ b/doc/man/ru/mc.1.in @@ -4673,12 +4673,15 @@ insert=\\e[Op Файл расширений пользователя. Если этот файл существует, он используется вместо общесистемного файла расширений. .PP +.I %sysconfdir%/mc/mc.ini +.RE .I %prefix%/share/mc/mc.ini .IP -Используемый по умолчанию общесистемный файл установок для Midnight -Commander; используется только в тех случаях, когда пользователь не -имеет своего файла -.B ~/.config/mc/ini +Общесистемные файлы установок для Midnight Commander; используются только +в тех случаях, когда пользователь не имеет своего файла +.B ~/.config/mc/ini . +Если файл %sysconfdir%/mc/mc.ini существует, то %prefix%/share/mc/mc.ini +не используется. .PP .I %prefix%/share/mc/mc.lib .IP From b9194d8c8a5763bc277e53078814ac13176dc471 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 4 Aug 2018 18:53:35 +0300 Subject: [PATCH 19/25] (dlg_init): fix possible NULL dereference. Signed-off-by: Andrew Borodin --- lib/widget/dialog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 8651ebca8..21d184eab 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -1139,7 +1139,8 @@ dlg_init (WDialog * h) widget_set_state (wh, WST_ACTIVE, TRUE); dlg_redraw (h); /* focus found widget */ - widget_set_state (WIDGET (h->current->data), WST_FOCUSED, TRUE); + if (h->current != NULL) + widget_set_state (WIDGET (h->current->data), WST_FOCUSED, TRUE); h->ret_value = 0; } From 669a8e3e1738a05eb62102042e9b353c33bdc17e Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 4 Aug 2018 19:10:27 +0300 Subject: [PATCH 20/25] (dlg_run_done): fix possible NULL dereference. Signed-off-by: Andrew Borodin --- lib/widget/dialog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 21d184eab..b8e98dbb9 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -1172,7 +1172,7 @@ dlg_run_done (WDialog * h) if (widget_get_state (WIDGET (h), WST_CLOSED)) { - send_message (h, h->current->data, MSG_END, 0, NULL); + send_message (h, h->current == NULL ? NULL : WIDGET (h->current->data), MSG_END, 0, NULL); if (!widget_get_state (WIDGET (h), WST_MODAL)) dialog_switch_remove (h); } From 357711da334f352da5f2e5c442844beaa1c72d93 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 19 Aug 2018 11:46:41 +0300 Subject: [PATCH 21/25] (filegui__check_attrs_on_fs): check copymove_persistent_attr before call. Signed-off-by: Andrew Borodin --- src/filemanager/filegui.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c index 7c8108fa0..3c63b2fb2 100644 --- a/src/filemanager/filegui.c +++ b/src/filemanager/filegui.c @@ -284,14 +284,12 @@ statvfs_works (void) #endif /* --------------------------------------------------------------------------------------------- */ + static gboolean filegui__check_attrs_on_fs (const char *fs_path) { STRUCT_STATVFS stfs; - if (!copymove_persistent_attr) - return FALSE; - #if USE_STATVFS && defined(STAT_STATVFS) if (statvfs_works () && statvfs (fs_path, &stfs) != 0) return TRUE; @@ -1181,7 +1179,7 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation, return NULL; /* unselect checkbox if target filesystem doesn't support attributes */ - ctx->op_preserve = filegui__check_attrs_on_fs (def_text); + ctx->op_preserve = copymove_persistent_attr && filegui__check_attrs_on_fs (def_text); ctx->stable_symlinks = FALSE; *do_bg = FALSE; From 88d61573230b09d2c23bb5d25ebf0adfa3ba9e2b Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 19 Aug 2018 11:52:30 +0300 Subject: [PATCH 22/25] (vfs_preallocate): check mc_global.vfs.preallocate_space before call. Signed-off-by: Andrew Borodin --- lib/vfs/vfs.c | 3 --- src/filemanager/file.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/vfs/vfs.c b/lib/vfs/vfs.c index ea58c2f32..5093e4293 100644 --- a/lib/vfs/vfs.c +++ b/lib/vfs/vfs.c @@ -650,9 +650,6 @@ vfs_preallocate (int dest_vfs_fd, off_t src_fsize, off_t dest_fsize) void *dest_fd = NULL; struct vfs_class *dest_class; - if (!mc_global.vfs.preallocate_space) - return 0; - if (src_fsize == 0) return 0; diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 937d43d77..ceea4d4fd 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -2367,7 +2367,8 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx, } /* try preallocate space; if fail, try copy anyway */ - while (vfs_preallocate (dest_desc, file_size, appending ? dst_stat.st_size : 0) != 0) + while (mc_global.vfs.preallocate_space && + vfs_preallocate (dest_desc, file_size, appending ? dst_stat.st_size : 0) != 0) { if (ctx->skip_all) { From 3909ef1bc579d5b530ea329535a3731173fc331d Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 4 Sep 2018 13:12:37 +0300 Subject: [PATCH 23/25] m4.include: move Gnulib modules to their own subdirectory. Signed-off-by: Andrew Borodin --- acinclude.m4 | 16 ++++++++-------- configure.ac | 2 +- m4.include/{ => gnulib}/fstypename.m4 | 0 m4.include/{ => gnulib}/fsusage.m4 | 0 m4.include/{ => gnulib}/ls-mntd-fs.m4 | 0 m4.include/{ => gnulib}/mode_t.m4 | 0 m4.include/{ => gnulib}/mountlist.m4 | 0 m4.include/{ => gnulib}/stat-size.m4 | 0 m4.include/{ => gnulib}/sys_types_h.m4 | 0 m4.include/{ => gnulib}/windows-stat-inodes.m4 | 0 10 files changed, 9 insertions(+), 9 deletions(-) rename m4.include/{ => gnulib}/fstypename.m4 (100%) rename m4.include/{ => gnulib}/fsusage.m4 (100%) rename m4.include/{ => gnulib}/ls-mntd-fs.m4 (100%) rename m4.include/{ => gnulib}/mode_t.m4 (100%) rename m4.include/{ => gnulib}/mountlist.m4 (100%) rename m4.include/{ => gnulib}/stat-size.m4 (100%) rename m4.include/{ => gnulib}/sys_types_h.m4 (100%) rename m4.include/{ => gnulib}/windows-stat-inodes.m4 (100%) diff --git a/acinclude.m4 b/acinclude.m4 index 8a0750400..ee9b88b2a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,17 +1,17 @@ m4_include([m4.include/ac_onceonly.m4]) +m4_include([m4.include/gnulib/mode_t.m4]) +m4_include([m4.include/gnulib/stat-size.m4]) +m4_include([m4.include/gnulib/ls-mntd-fs.m4]) +m4_include([m4.include/gnulib/fstypename.m4]) +m4_include([m4.include/gnulib/fsusage.m4]) +m4_include([m4.include/gnulib/mountlist.m4]) +m4_include([m4.include/gnulib/windows-stat-inodes.m4]) +m4_include([m4.include/gnulib/sys_types_h.m4]) m4_include([m4.include/ax_path_lib_pcre.m4]) m4_include([m4.include/dx_doxygen.m4]) m4_include([m4.include/mc-cflags.m4]) m4_include([m4.include/ax_gcc_func_attribute.m4]) m4_include([m4.include/mc-check-search-type.m4]) -m4_include([m4.include/mode_t.m4]) -m4_include([m4.include/stat-size.m4]) -m4_include([m4.include/ls-mntd-fs.m4]) -m4_include([m4.include/fstypename.m4]) -m4_include([m4.include/fsusage.m4]) -m4_include([m4.include/mountlist.m4]) -m4_include([m4.include/windows-stat-inodes.m4]) -m4_include([m4.include/sys_types_h.m4]) m4_include([m4.include/mc-get-fs-info.m4]) m4_include([m4.include/mc-with-x.m4]) m4_include([m4.include/mc-use-termcap.m4]) diff --git a/configure.ac b/configure.ac index cdf5a8b6c..62f025a8c 100644 --- a/configure.ac +++ b/configure.ac @@ -160,7 +160,7 @@ AC_CHECK_HEADERS([string.h memory.h limits.h malloc.h \ utime.h sys/statfs.h sys/vfs.h \ sys/select.h sys/ioctl.h stropts.h arpa/inet.h \ sys/socket.h]) -dnl This macro is redefined in m4.include/sys_types_h.m4 +dnl This macro is redefined in m4.include/gnulib/sys_types_h.m4 dnl to work around a buggy version in autoconf <= 2.69. AC_HEADER_MAJOR diff --git a/m4.include/fstypename.m4 b/m4.include/gnulib/fstypename.m4 similarity index 100% rename from m4.include/fstypename.m4 rename to m4.include/gnulib/fstypename.m4 diff --git a/m4.include/fsusage.m4 b/m4.include/gnulib/fsusage.m4 similarity index 100% rename from m4.include/fsusage.m4 rename to m4.include/gnulib/fsusage.m4 diff --git a/m4.include/ls-mntd-fs.m4 b/m4.include/gnulib/ls-mntd-fs.m4 similarity index 100% rename from m4.include/ls-mntd-fs.m4 rename to m4.include/gnulib/ls-mntd-fs.m4 diff --git a/m4.include/mode_t.m4 b/m4.include/gnulib/mode_t.m4 similarity index 100% rename from m4.include/mode_t.m4 rename to m4.include/gnulib/mode_t.m4 diff --git a/m4.include/mountlist.m4 b/m4.include/gnulib/mountlist.m4 similarity index 100% rename from m4.include/mountlist.m4 rename to m4.include/gnulib/mountlist.m4 diff --git a/m4.include/stat-size.m4 b/m4.include/gnulib/stat-size.m4 similarity index 100% rename from m4.include/stat-size.m4 rename to m4.include/gnulib/stat-size.m4 diff --git a/m4.include/sys_types_h.m4 b/m4.include/gnulib/sys_types_h.m4 similarity index 100% rename from m4.include/sys_types_h.m4 rename to m4.include/gnulib/sys_types_h.m4 diff --git a/m4.include/windows-stat-inodes.m4 b/m4.include/gnulib/windows-stat-inodes.m4 similarity index 100% rename from m4.include/windows-stat-inodes.m4 rename to m4.include/gnulib/windows-stat-inodes.m4 From a7ff88d24ce3edce1607ec431b6701ea5b0220c6 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 4 Sep 2018 13:52:10 +0300 Subject: [PATCH 24/25] (init_subshell): use openpty() to open master/slave devices for subshell. Thanks Jesse R. Gorzinski for the original patch. Signed-off-by: Andrew Borodin --- m4.include/mc-subshell.m4 | 9 +++++++++ src/subshell/common.c | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/m4.include/mc-subshell.m4 b/m4.include/mc-subshell.m4 index 54b4a01e1..6c17be6f9 100644 --- a/m4.include/mc-subshell.m4 +++ b/m4.include/mc-subshell.m4 @@ -24,6 +24,15 @@ AC_DEFUN([mc_SUBSHELL], [ if test "x$result" != xno; then AC_DEFINE(ENABLE_SUBSHELL, 1, [Define to enable subshell support]) + + dnl openpty() can simplify opening of master/slave devices for subshell + AC_CHECK_HEADERS([pty.h libutil.h util.h]) + AC_CHECK_FUNCS(openpty,, + AC_CHECK_LIB(util,openpty, + [AC_DEFINE(HAVE_OPENPTY) + LIBS="$LIBS -lutil"] + ) + ) fi AC_MSG_RESULT([$result]) diff --git a/src/subshell/common.c b/src/subshell/common.c index 505fbe325..bf8fca10a 100644 --- a/src/subshell/common.c +++ b/src/subshell/common.c @@ -74,6 +74,20 @@ #include /* For I_PUSH */ #endif /* HAVE_STROPTS_H */ +#ifdef HAVE_OPENPTY +/* includes for openpty() */ +#if HAVE_PTY_H +#include +#endif +#if HAVE_UTIL_H +#include +#endif +/* is a prerequisite of on FreeBSD 8.0. */ +#if HAVE_LIBUTIL_H +#include +#endif +#endif /* HAVE_OPENPTY */ + #include "lib/global.h" #include "lib/unixcompat.h" @@ -1026,6 +1040,15 @@ init_subshell (void) /* FIXME: We may need to open a fresh pty each time on SVR4 */ +#ifdef HAVE_OPENPTY + if (openpty (&mc_global.tty.subshell_pty, &subshell_pty_slave, NULL, NULL, NULL)) + { + fprintf (stderr, "Cannot open master and slave sides of pty: %s\n", + unix_error_string (errno)); + mc_global.tty.use_subshell = FALSE; + return; + } +#else mc_global.tty.subshell_pty = pty_open_master (pty_name); if (mc_global.tty.subshell_pty == -1) { @@ -1041,6 +1064,7 @@ init_subshell (void) mc_global.tty.use_subshell = FALSE; return; } +#endif /* HAVE_OPENPTY */ /* Create a pipe for receiving the subshell's CWD */ From dd1c41867729825a3ab45f3ddae2bc77c1c4c7a3 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 9 Sep 2018 19:17:18 +0300 Subject: [PATCH 25/25] Update po/*.po files. Signed-off-by: Andrew Borodin --- po/az.po | 10 +- po/be.po | 10 +- po/bg.po | 10 +- po/ca.po | 10 +- po/cs.po | 10 +- po/da.po | 10 +- po/de.po | 10 +- po/de_CH.po | 10 +- po/el.po | 10 +- po/en_GB.po | 10 +- po/eo.po | 10 +- po/es.po | 10 +- po/et.po | 10 +- po/eu.po | 10 +- po/fa.po | 10 +- po/fi.po | 10 +- po/fr.po | 10 +- po/fr_CA.po | 10 +- po/gl.po | 10 +- po/hr.po | 10 +- po/hu.po | 10 +- po/ia.po | 10 +- po/id.po | 10 +- po/it.po | 10 +- po/ja.po | 10 +- po/ka.po | 10 +- po/kk.po | 10 +- po/ko.po | 10 +- po/lt.po | 10 +- po/lv.po | 10 +- po/mc.pot | 498 +++++++++++++++++++++++++++------------------------- po/mn.po | 10 +- po/nb.po | 10 +- po/nl.po | 10 +- po/pl.po | 10 +- po/pt.po | 10 +- po/pt_BR.po | 10 +- po/ro.po | 10 +- po/ru.po | 35 ++-- po/sk.po | 10 +- po/sl.po | 10 +- po/sr.po | 10 +- po/sv.po | 10 +- po/szl.po | 10 +- po/ta.po | 10 +- po/te.po | 10 +- po/tr.po | 10 +- po/uk.po | 10 +- po/vi.po | 10 +- po/wa.po | 10 +- po/zh_CN.po | 10 +- po/zh_TW.po | 10 +- 52 files changed, 723 insertions(+), 310 deletions(-) diff --git a/po/az.po b/po/az.po index f16c1b3fa..6b90c360e 100644 --- a/po/az.po +++ b/po/az.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Azerbaijani (http://www.transifex.com/mc/mc/language/az/)\n" @@ -2839,6 +2839,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Faylı tap" + msgid "Searching" msgstr "Axtarılır" diff --git a/po/be.po b/po/be.po index e2ac93d5b..e8c667453 100644 --- a/po/be.po +++ b/po/be.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-21 16:57+0000\n" "Last-Translator: Zmicer Turok \n" "Language-Team: Belarusian (http://www.transifex.com/mc/mc/language/be/)\n" @@ -3031,6 +3031,14 @@ msgstr[1] "Завершана (мінута %zu каталогі)" msgstr[2] "Завершана (мінута %zu каталогаў)" msgstr[3] "Завершана (мінута %zu каталогаў)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Шукаць файл" + msgid "Searching" msgstr "Пошук" diff --git a/po/bg.po b/po/bg.po index 6c0919a6b..d16aa3982 100644 --- a/po/bg.po +++ b/po/bg.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Bulgarian (http://www.transifex.com/mc/mc/language/bg/)\n" @@ -3017,6 +3017,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Завършено (игнорирана %zu директория)" msgstr[1] "Завършено (игнорирани %zu директории)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Търси файл" + msgid "Searching" msgstr "Търся" diff --git a/po/ca.po b/po/ca.po index 5edb9ee57..398b8ebcb 100644 --- a/po/ca.po +++ b/po/ca.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-21 16:46+0000\n" "Last-Translator: Marc Tormo i Bochaca \n" "Language-Team: Catalan (http://www.transifex.com/mc/mc/language/ca/)\n" @@ -3041,6 +3041,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Finalitzada (s'ha ignorat %zu directori)" msgstr[1] "Finalitzada (s'han ignorat %zu directoris)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Cerca el fitxer" + msgid "Searching" msgstr "Cercant" diff --git a/po/cs.po b/po/cs.po index c767f0960..9f79479b4 100644 --- a/po/cs.po +++ b/po/cs.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-22 14:53+0000\n" "Last-Translator: Pavel Borecki \n" "Language-Team: Czech (http://www.transifex.com/mc/mc/language/cs/)\n" @@ -3036,6 +3036,14 @@ msgstr[1] "Dokončeno (ignorovány %zu adresáře)" msgstr[2] "Dokončeno (ignorováno %zu složek)" msgstr[3] "Dokončeno (ignorováno %zu složek)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Najít soubor" + msgid "Searching" msgstr "Hledá se" diff --git a/po/da.po b/po/da.po index cd41f8b2c..364dba2c3 100644 --- a/po/da.po +++ b/po/da.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-15 17:16+0000\n" "Last-Translator: Morten Bo Johansen \n" "Language-Team: Danish (http://www.transifex.com/mc/mc/language/da/)\n" @@ -3030,6 +3030,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Færdig (ignorerede %zu mappe)" msgstr[1] "Færdig (ignorerede %zu mapper)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Find fil" + msgid "Searching" msgstr "Søger" diff --git a/po/de.po b/po/de.po index 837bee49c..bf44cfe91 100644 --- a/po/de.po +++ b/po/de.po @@ -18,7 +18,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: German (http://www.transifex.com/mc/mc/language/de/)\n" @@ -3046,6 +3046,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Abgeschlossen (ignoriert %zu Verzeichnis)" msgstr[1] "Abgeschlossen (ignorierte %zu Verzeichnisse)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Datei suchen" + msgid "Searching" msgstr "Suche " diff --git a/po/de_CH.po b/po/de_CH.po index 0b7e0ef5c..dd470f514 100644 --- a/po/de_CH.po +++ b/po/de_CH.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2015-02-26 09:48+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: German (Switzerland) (http://www.transifex.com/projects/p/mc/" @@ -2837,6 +2837,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/el.po b/po/el.po index 542410632..8d283919d 100644 --- a/po/el.po +++ b/po/el.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Greek (http://www.transifex.com/mc/mc/language/el/)\n" @@ -2929,6 +2929,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Εύρεση αρχείου" + msgid "Searching" msgstr "Αναζήτηση" diff --git a/po/en_GB.po b/po/en_GB.po index d8b40a7ae..e3957784d 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: English (United Kingdom) (http://www.transifex.com/mc/mc/" @@ -2847,6 +2847,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/eo.po b/po/eo.po index 81eb12bc0..266038088 100644 --- a/po/eo.po +++ b/po/eo.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Esperanto (http://www.transifex.com/mc/mc/language/eo/)\n" @@ -3027,6 +3027,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Finita (ignoris %zu dosierujon)" msgstr[1] "Finita (ignoris %zu dosierujojn)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Trovi dosieron" + msgid "Searching" msgstr "Serĉanta" diff --git a/po/es.po b/po/es.po index 71c0adbcc..3b37c44a5 100644 --- a/po/es.po +++ b/po/es.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 20:11+0000\n" "Last-Translator: David Martin \n" "Language-Team: Spanish (http://www.transifex.com/mc/mc/language/es/)\n" @@ -3033,6 +3033,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Terminado (%zu directorio ignorado)" msgstr[1] "Terminado (%zu directorios ignorados)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr " Buscar archivos " + msgid "Searching" msgstr "Buscando" diff --git a/po/et.po b/po/et.po index fc7258676..0eb8d5f4b 100644 --- a/po/et.po +++ b/po/et.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Estonian (http://www.transifex.com/mc/mc/language/et/)\n" @@ -3023,6 +3023,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Lõpetatud (%zu kataloogi eirati)" msgstr[1] "Lõpetatud (%zu kataloogi eirati)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Failide otsimine" + msgid "Searching" msgstr "Otsimine" diff --git a/po/eu.po b/po/eu.po index 449698f6d..fc71eb498 100644 --- a/po/eu.po +++ b/po/eu.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-12 11:25+0000\n" "Last-Translator: Iñigo Salvador Azurmendi \n" "Language-Team: Basque (http://www.transifex.com/mc/mc/language/eu/)\n" @@ -3027,6 +3027,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Amaituta (%zu direktorioa baztertuta)" msgstr[1] "Amaituta (%zu direktorioak baztertuta)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Bilatu fitxategia" + msgid "Searching" msgstr "Bilatzen" diff --git a/po/fa.po b/po/fa.po index ca11608ad..c057dce1d 100644 --- a/po/fa.po +++ b/po/fa.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Persian (http://www.transifex.com/mc/mc/language/fa/)\n" @@ -2841,6 +2841,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "جستجوی فایل" + msgid "Searching" msgstr "در حال جستجو" diff --git a/po/fi.po b/po/fi.po index a4e7aab39..1228fbeba 100644 --- a/po/fi.po +++ b/po/fi.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Finnish (http://www.transifex.com/mc/mc/language/fi/)\n" @@ -2848,6 +2848,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Tiedosto: %s" + msgid "Searching" msgstr "" diff --git a/po/fr.po b/po/fr.po index 679286228..47517d3f0 100644 --- a/po/fr.po +++ b/po/fr.po @@ -17,7 +17,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-03 09:01+0000\n" "Last-Translator: David Prudhomme \n" "Language-Team: French (http://www.transifex.com/mc/mc/language/fr/)\n" @@ -3042,6 +3042,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Terminé (%zu répertoire ignoré)" msgstr[1] "Terminé (%zu répertoires ignorés)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Recherche de fichier" + msgid "Searching" msgstr "Recherche en cours" diff --git a/po/fr_CA.po b/po/fr_CA.po index 0881dbf32..14e58f96c 100644 --- a/po/fr_CA.po +++ b/po/fr_CA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2015-02-26 09:48+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: French (Canada) (http://www.transifex.com/projects/p/mc/" @@ -2837,6 +2837,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/gl.po b/po/gl.po index 119b330b6..0a9b00bd3 100644 --- a/po/gl.po +++ b/po/gl.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Galician (http://www.transifex.com/mc/mc/language/gl/)\n" @@ -3022,6 +3022,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Buscar ficheiro" + msgid "Searching" msgstr "Buscando" diff --git a/po/hr.po b/po/hr.po index 60273ac90..37e0f17c3 100644 --- a/po/hr.po +++ b/po/hr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Croatian (http://www.transifex.com/mc/mc/language/hr/)\n" @@ -2838,6 +2838,14 @@ msgstr[0] "" msgstr[1] "" msgstr[2] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/hu.po b/po/hu.po index af4c06c21..ddf9b2a82 100644 --- a/po/hu.po +++ b/po/hu.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Hungarian (http://www.transifex.com/mc/mc/language/hu/)\n" @@ -3015,6 +3015,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Fájl keresése" + msgid "Searching" msgstr "Keresés" diff --git a/po/ia.po b/po/ia.po index 0c0b2c13c..e4307662d 100644 --- a/po/ia.po +++ b/po/ia.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Interlingua (http://www.transifex.com/mc/mc/language/ia/)\n" @@ -2857,6 +2857,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "File: %s" + msgid "Searching" msgstr "Cerca" diff --git a/po/id.po b/po/id.po index 4c993607d..2a1e27fbe 100644 --- a/po/id.po +++ b/po/id.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Indonesian (http://www.transifex.com/mc/mc/language/id/)\n" @@ -2879,6 +2879,14 @@ msgid "Finished (ignored %zu directory)" msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/it.po b/po/it.po index 6fc559577..ae1fcb746 100644 --- a/po/it.po +++ b/po/it.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-04-25 11:40+0300\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-30 09:39+0200\n" "Last-Translator: Marco Ciampa \n" "Language-Team: Italian (http://www.transifex.com/projects/p/mc/language/" @@ -3029,6 +3029,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Finito (ignorata %zu directory)" msgstr[1] "Finito (ignorate %zu directory)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr " Trova file " + msgid "Searching" msgstr "Cercando" diff --git a/po/ja.po b/po/ja.po index 069d08770..00f35fe86 100644 --- a/po/ja.po +++ b/po/ja.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Japanese (http://www.transifex.com/mc/mc/language/ja/)\n" @@ -2854,6 +2854,14 @@ msgid "Finished (ignored %zu directory)" msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "ファイル検索" + msgid "Searching" msgstr "検索" diff --git a/po/ka.po b/po/ka.po index 6d880d4ee..e6a03d1a5 100644 --- a/po/ka.po +++ b/po/ka.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Georgian (http://www.transifex.com/mc/mc/language/ka/)\n" @@ -2840,6 +2840,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/kk.po b/po/kk.po index b8f794d31..74532326b 100644 --- a/po/kk.po +++ b/po/kk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Kazakh (http://www.transifex.com/mc/mc/language/kk/)\n" @@ -2837,6 +2837,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/ko.po b/po/ko.po index a579248f2..c2b02d900 100644 --- a/po/ko.po +++ b/po/ko.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Korean (http://www.transifex.com/mc/mc/language/ko/)\n" @@ -2846,6 +2846,14 @@ msgid "Finished (ignored %zu directory)" msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "파일 찾기" + msgid "Searching" msgstr "찾는 중" diff --git a/po/lt.po b/po/lt.po index 6ac6555e8..4491d3add 100644 --- a/po/lt.po +++ b/po/lt.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Lithuanian (http://www.transifex.com/mc/mc/language/lt/)\n" @@ -2898,6 +2898,14 @@ msgstr[1] "" msgstr[2] "" msgstr[3] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Rasti failą" + msgid "Searching" msgstr "Ieškoma" diff --git a/po/lv.po b/po/lv.po index e519ebfb8..15a3e9d4f 100644 --- a/po/lv.po +++ b/po/lv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Latvian (http://www.transifex.com/mc/mc/language/lv/)\n" @@ -2842,6 +2842,14 @@ msgstr[0] "" msgstr[1] "" msgstr[2] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Atrast Failu" + msgid "Searching" msgstr "Meklēju" diff --git a/po/mc.pot b/po/mc.pot index aefaaf589..d7ccbeeeb 100644 --- a/po/mc.pot +++ b/po/mc.pot @@ -5,9 +5,9 @@ # msgid "" msgstr "" -"Project-Id-Version: mc 4.8.20-131-g34712ec\n" +"Project-Id-Version: mc 4.8.21-55-ga7ff88d\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-04-25 11:40+0300\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -152,7 +152,7 @@ msgstr "" msgid "No&rmal" msgstr "" -#: lib/search/search.c:54 src/filemanager/find.c:590 +#: lib/search/search.c:54 src/filemanager/find.c:591 msgid "Re&gular expression" msgstr "" @@ -653,8 +653,8 @@ msgstr "" #: src/editor/editcmd.c:422 src/editor/editcmd.c:584 src/editor/editcmd.c:1720 #: src/editor/editcmd.c:3436 src/editor/editcmd.c:3465 #: src/editor/editcmd_dialogs.c:478 src/execute.c:135 -#: src/filemanager/file.c:2305 src/filemanager/panel.c:4479 src/help.c:362 -#: src/main.c:401 src/subshell/common.c:418 src/subshell/common.c:1246 +#: src/filemanager/file.c:2281 src/filemanager/panel.c:4479 src/help.c:362 +#: src/main.c:401 src/subshell/common.c:432 src/subshell/common.c:1275 #: src/viewer/actions_cmd.c:419 msgid "Warning" msgstr "" @@ -676,21 +676,21 @@ msgstr "" msgid "Directory cache expired for %s" msgstr "" -#: lib/vfs/direntry.c:679 +#: lib/vfs/direntry.c:702 #, c-format msgid "%s: %s: %s %3d%% (%lld) bytes transferred" msgstr "" -#: lib/vfs/direntry.c:682 +#: lib/vfs/direntry.c:705 #, c-format msgid "%s: %s: %s %lld bytes transferred" msgstr "" -#: lib/vfs/direntry.c:1316 +#: lib/vfs/direntry.c:1350 msgid "Starting linear transfer..." msgstr "" -#: lib/vfs/direntry.c:1423 +#: lib/vfs/direntry.c:1450 msgid "Getting file" msgstr "" @@ -768,11 +768,11 @@ msgstr "" #: lib/widget/listbox.c:325 src/diffviewer/ydiff.c:3089 src/editor/edit.c:359 #: src/editor/editcmd.c:231 src/editor/editcmd.c:254 src/editor/editcmd.c:2851 #: src/editor/editcmd.c:2857 src/filemanager/cmd.c:140 -#: src/filemanager/file.c:880 src/filemanager/file.c:1863 -#: src/filemanager/filegui.c:434 src/filemanager/hotlist.c:1158 +#: src/filemanager/file.c:877 src/filemanager/file.c:1857 +#: src/filemanager/filegui.c:432 src/filemanager/hotlist.c:1158 #: src/filemanager/hotlist.c:1175 src/filemanager/midnight.c:1026 #: src/filemanager/midnight.c:1034 src/filemanager/panel.c:2820 -#: src/filemanager/tree.c:828 src/subshell/common.c:1248 +#: src/filemanager/tree.c:828 src/subshell/common.c:1277 #: src/viewer/actions_cmd.c:619 src/viewer/actions_cmd.c:625 #: src/viewer/search.c:398 msgid "&Yes" @@ -780,21 +780,21 @@ msgstr "" #: lib/widget/listbox.c:325 src/diffviewer/ydiff.c:3089 src/editor/edit.c:359 #: src/editor/editcmd.c:231 src/editor/editcmd.c:2851 src/editor/editcmd.c:2857 -#: src/filemanager/cmd.c:140 src/filemanager/file.c:880 -#: src/filemanager/file.c:1863 src/filemanager/filegui.c:436 +#: src/filemanager/cmd.c:140 src/filemanager/file.c:877 +#: src/filemanager/file.c:1857 src/filemanager/filegui.c:434 #: src/filemanager/hotlist.c:1158 src/filemanager/hotlist.c:1175 #: src/filemanager/midnight.c:1026 src/filemanager/midnight.c:1034 #: src/filemanager/panel.c:2820 src/filemanager/tree.c:828 -#: src/subshell/common.c:1248 src/viewer/actions_cmd.c:619 +#: src/subshell/common.c:1277 src/viewer/actions_cmd.c:619 #: src/viewer/actions_cmd.c:625 src/viewer/search.c:399 msgid "&No" msgstr "" #: lib/widget/quick.h:215 src/editor/editcmd.c:2717 #: src/editor/editcmd_dialogs.c:121 src/editor/editwidget.c:150 -#: src/filemanager/boxes.c:1243 src/filemanager/filegui.c:1254 -#: src/filemanager/find.c:598 src/filemanager/layout.c:458 -#: src/subshell/common.c:421 +#: src/filemanager/boxes.c:1243 src/filemanager/filegui.c:1252 +#: src/filemanager/find.c:599 src/filemanager/layout.c:458 +#: src/subshell/common.c:435 msgid "&OK" msgstr "" @@ -808,7 +808,7 @@ msgstr "" #: src/filemanager/achown.c:882 src/filemanager/chmod.c:117 #: src/filemanager/chmod.c:411 src/filemanager/chown.c:88 #: src/filemanager/chown.c:310 src/filemanager/cmd.c:1148 -#: src/filemanager/filegui.c:1258 src/filemanager/find.c:598 +#: src/filemanager/filegui.c:1256 src/filemanager/find.c:599 #: src/filemanager/hotlist.c:187 src/filemanager/hotlist.c:1014 #: src/filemanager/hotlist.c:1076 src/filemanager/layout.c:459 #: src/filemanager/panelize.c:140 src/learn.c:256 src/viewer/hex.c:430 @@ -834,10 +834,10 @@ msgstr "" msgid "%s (%d)" msgstr "" -#: lib/widget/wtools.c:691 src/filemanager/file.c:768 -#: src/filemanager/file.c:839 src/filemanager/file.c:881 -#: src/filemanager/file.c:2987 src/filemanager/filegui.c:256 -#: src/filemanager/filegui.c:452 +#: lib/widget/wtools.c:691 src/filemanager/file.c:765 +#: src/filemanager/file.c:836 src/filemanager/file.c:878 +#: src/filemanager/file.c:2972 src/filemanager/filegui.c:256 +#: src/filemanager/filegui.c:450 msgid "&Abort" msgstr "" @@ -1055,7 +1055,7 @@ msgstr "" msgid "Reading failed" msgstr "" -#: src/background.c:217 src/filemanager/file.c:765 src/filemanager/file.c:837 +#: src/background.c:217 src/filemanager/file.c:762 src/filemanager/file.c:834 msgid "Background process error" msgstr "" @@ -1086,7 +1086,7 @@ msgstr "" #: src/diffviewer/search.c:92 src/editor/editcmd_dialogs.c:112 #: src/editor/editcmd_dialogs.c:209 src/filemanager/boxes.c:639 -#: src/filemanager/boxes.c:860 src/filemanager/find.c:584 +#: src/filemanager/boxes.c:860 src/filemanager/find.c:585 #: src/viewer/dialogs.c:97 msgid "Cas&e sensitive" msgstr "" @@ -1097,13 +1097,13 @@ msgid "&Backwards" msgstr "" #: src/diffviewer/search.c:94 src/editor/editcmd_dialogs.c:115 -#: src/editor/editcmd_dialogs.c:212 src/filemanager/find.c:595 +#: src/editor/editcmd_dialogs.c:212 src/filemanager/find.c:596 #: src/viewer/dialogs.c:99 msgid "&Whole words" msgstr "" #: src/diffviewer/search.c:96 src/editor/editcmd_dialogs.c:117 -#: src/editor/editcmd_dialogs.c:214 src/filemanager/find.c:582 +#: src/editor/editcmd_dialogs.c:214 src/filemanager/find.c:583 #: src/viewer/dialogs.c:101 msgid "&All charsets" msgstr "" @@ -1265,7 +1265,7 @@ msgid "\"%s\" is a directory" msgstr "" #: src/diffviewer/ydiff.c:3590 src/diffviewer/ydiff.c:3607 -#: src/filemanager/file.c:1667 src/viewer/mcviewer.c:339 +#: src/filemanager/file.c:1664 src/viewer/mcviewer.c:339 #, c-format msgid "" "Cannot stat \"%s\"\n" @@ -1347,7 +1347,7 @@ msgstr "" msgid "Searching %s: %3d%%" msgstr "" -#: src/editor/editcmd.c:130 src/filemanager/find.c:1343 src/viewer/search.c:85 +#: src/editor/editcmd.c:130 src/filemanager/find.c:1344 src/viewer/search.c:85 #, c-format msgid "Searching %s" msgstr "" @@ -1700,14 +1700,14 @@ msgstr "" msgid "&Replace" msgstr "" -#: src/editor/editcmd_dialogs.c:280 src/filemanager/file.c:880 -#: src/filemanager/filegui.c:444 +#: src/editor/editcmd_dialogs.c:280 src/filemanager/file.c:877 +#: src/filemanager/filegui.c:442 msgid "A&ll" msgstr "" #: src/editor/editcmd_dialogs.c:281 src/editor/spell_dialogs.c:97 -#: src/filemanager/file.c:768 src/filemanager/file.c:839 -#: src/filemanager/file.c:2988 src/filemanager/filegui.c:253 +#: src/filemanager/file.c:765 src/filemanager/file.c:836 +#: src/filemanager/file.c:2973 src/filemanager/filegui.c:253 msgid "&Skip" msgstr "" @@ -1761,8 +1761,8 @@ msgstr "" msgid "A&bout..." msgstr "" -#: src/editor/editmenu.c:87 src/filemanager/find.c:193 -#: src/subshell/common.c:421 +#: src/editor/editmenu.c:87 src/filemanager/find.c:194 +#: src/subshell/common.c:435 msgid "&Quit" msgstr "" @@ -1802,7 +1802,7 @@ msgstr "" msgid "Mo&ve" msgstr "" -#: src/editor/editmenu.c:112 src/filemanager/file.c:2595 +#: src/editor/editmenu.c:112 src/filemanager/file.c:2580 #: src/filemanager/midnight.c:254 msgid "&Delete" msgstr "" @@ -2373,7 +2373,7 @@ msgstr "" #: src/filemanager/achown.c:846 src/filemanager/achown.c:881 #: src/filemanager/chmod.c:410 src/filemanager/chown.c:309 -#: src/filemanager/file.c:839 src/viewer/hex.c:430 +#: src/filemanager/file.c:836 src/viewer/hex.c:430 msgid "&Retry" msgstr "" @@ -2402,7 +2402,7 @@ msgstr "" msgid "Running" msgstr "" -#: src/filemanager/boxes.c:434 src/filemanager/find.c:1561 +#: src/filemanager/boxes.c:434 src/filemanager/find.c:1596 msgid "Stopped" msgstr "" @@ -3110,7 +3110,7 @@ msgid "" msgstr "" #: src/filemanager/cmd.c:1437 src/filemanager/cmd.c:1472 -#: src/filemanager/file.c:681 +#: src/filemanager/file.c:678 msgid "Directory scanning" msgstr "" @@ -3180,7 +3180,7 @@ msgid "" "to copy it from %smc.ext or use that file as an example of how to write it." msgstr "" -#: src/filemanager/file.c:95 src/filemanager/file.c:2594 +#: src/filemanager/file.c:95 src/filemanager/file.c:2579 #: src/filemanager/tree.c:716 msgid "DialogTitle|Copy" msgstr "" @@ -3237,32 +3237,32 @@ msgstr "" msgid " with source mask:" msgstr "" -#: src/filemanager/file.c:379 +#: src/filemanager/file.c:376 msgid "Cannot make the hardlink" msgstr "" -#: src/filemanager/file.c:431 +#: src/filemanager/file.c:428 #, c-format msgid "" "Cannot read source link \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:445 +#: src/filemanager/file.c:442 msgid "" "Cannot make stable symlinks across non-local filesystems:\n" "\n" "Option Stable Symlinks will be disabled" msgstr "" -#: src/filemanager/file.c:514 +#: src/filemanager/file.c:511 #, c-format msgid "" "Cannot create target symlink \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:807 +#: src/filemanager/file.c:804 #, c-format msgid "" "\"%s\"\n" @@ -3271,7 +3271,7 @@ msgid "" "are the same directory" msgstr "" -#: src/filemanager/file.c:809 +#: src/filemanager/file.c:806 #, c-format msgid "" "\"%s\"\n" @@ -3280,18 +3280,18 @@ msgid "" "are the same file" msgstr "" -#: src/filemanager/file.c:839 +#: src/filemanager/file.c:836 msgid "Ski&p all" msgstr "" -#: src/filemanager/file.c:872 +#: src/filemanager/file.c:869 #, c-format msgid "" "Directory \"%s\" not empty.\n" "Delete it recursively?" msgstr "" -#: src/filemanager/file.c:873 +#: src/filemanager/file.c:870 #, c-format msgid "" "Background process:\n" @@ -3299,197 +3299,197 @@ msgid "" "Delete it recursively?" msgstr "" -#: src/filemanager/file.c:881 src/filemanager/filegui.c:448 +#: src/filemanager/file.c:878 src/filemanager/filegui.c:446 msgid "Non&e" msgstr "" -#: src/filemanager/file.c:1080 +#: src/filemanager/file.c:1077 #, c-format msgid "" "Cannot remove file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:1138 +#: src/filemanager/file.c:1135 #, c-format msgid "" "Cannot stat file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:1154 +#: src/filemanager/file.c:1151 #, c-format msgid "Cannot overwrite directory \"%s\"" msgstr "" -#: src/filemanager/file.c:1200 +#: src/filemanager/file.c:1197 #, c-format msgid "" "Cannot move file \"%s\" to \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:1303 +#: src/filemanager/file.c:1300 #, c-format msgid "" "Cannot remove directory \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:1531 src/filemanager/file.c:2169 +#: src/filemanager/file.c:1528 src/filemanager/file.c:2145 #, c-format msgid "" "Cannot overwrite directory \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:1533 +#: src/filemanager/file.c:1530 #, c-format msgid "" "Cannot overwrite file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:1554 +#: src/filemanager/file.c:1551 #, c-format msgid "" "Cannot move directory \"%s\" to \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:1656 +#: src/filemanager/file.c:1653 msgid "Cannot operate on \"..\"!" msgstr "" -#: src/filemanager/file.c:2188 +#: src/filemanager/file.c:2164 #, c-format msgid "" "Cannot stat source file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2242 +#: src/filemanager/file.c:2218 #, c-format msgid "" "Cannot create special file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2254 src/filemanager/file.c:2605 +#: src/filemanager/file.c:2230 src/filemanager/file.c:2590 #, c-format msgid "" "Cannot chown target file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2269 src/filemanager/file.c:2625 +#: src/filemanager/file.c:2245 src/filemanager/file.c:2610 #, c-format msgid "" "Cannot chmod target file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2290 +#: src/filemanager/file.c:2266 #, c-format msgid "" "Cannot open source file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2305 +#: src/filemanager/file.c:2281 msgid "Reget failed, about to overwrite file" msgstr "" -#: src/filemanager/file.c:2317 +#: src/filemanager/file.c:2293 #, c-format msgid "" "Cannot fstat source file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2354 +#: src/filemanager/file.c:2330 #, c-format msgid "" "Cannot create target file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2376 +#: src/filemanager/file.c:2360 #, c-format msgid "" "Cannot fstat target file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2396 +#: src/filemanager/file.c:2381 #, c-format msgid "" "Cannot preallocate space for target file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2452 +#: src/filemanager/file.c:2437 #, c-format msgid "" "Cannot read source file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2497 +#: src/filemanager/file.c:2482 #, c-format msgid "" "Cannot write target file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2532 +#: src/filemanager/file.c:2517 msgid "(stalled)" msgstr "" -#: src/filemanager/file.c:2570 +#: src/filemanager/file.c:2555 #, c-format msgid "" "Cannot close source file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2582 +#: src/filemanager/file.c:2567 #, c-format msgid "" "Cannot close target file \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2594 +#: src/filemanager/file.c:2579 msgid "Incomplete file was retrieved. Keep it?" msgstr "" -#: src/filemanager/file.c:2595 +#: src/filemanager/file.c:2580 msgid "&Keep" msgstr "" -#: src/filemanager/file.c:2690 +#: src/filemanager/file.c:2675 #, c-format msgid "" "Cannot stat source directory \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2724 +#: src/filemanager/file.c:2709 #, c-format msgid "" "Source \"%s\" is not a directory\n" "%s" msgstr "" -#: src/filemanager/file.c:2736 +#: src/filemanager/file.c:2721 #, c-format msgid "" "Cannot copy cyclic symbolic link\n" "\"%s\"" msgstr "" -#: src/filemanager/file.c:2774 src/filemanager/file.c:3257 +#: src/filemanager/file.c:2759 src/filemanager/file.c:3242 #: src/filemanager/tree.c:773 #, c-format msgid "" @@ -3497,288 +3497,298 @@ msgid "" "%s" msgstr "" -#: src/filemanager/file.c:2806 +#: src/filemanager/file.c:2791 #, c-format msgid "" "Cannot create target directory \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:2830 +#: src/filemanager/file.c:2815 #, c-format msgid "" "Cannot chown target directory \"%s\"\n" "%s" msgstr "" -#: src/filemanager/file.c:3029 +#: src/filemanager/file.c:3014 #, c-format msgid "Directories: %zu, total size: %s" msgstr "" -#: src/filemanager/file.c:3173 +#: src/filemanager/file.c:3158 msgid "Sorry, I could not put the job in background" msgstr "" -#: src/filemanager/filegui.c:254 src/filemanager/find.c:191 +#: src/filemanager/filegui.c:254 src/filemanager/find.c:192 msgid "S&uspend" msgstr "" -#: src/filemanager/filegui.c:255 src/filemanager/find.c:192 +#: src/filemanager/filegui.c:255 src/filemanager/find.c:193 msgid "Con&tinue" msgstr "" -#: src/filemanager/filegui.c:346 +#: src/filemanager/filegui.c:344 #, c-format msgid "%d:%02d.%02d" msgstr "" -#: src/filemanager/filegui.c:363 +#: src/filemanager/filegui.c:361 #, c-format msgid "ETA %s" msgstr "" -#: src/filemanager/filegui.c:373 +#: src/filemanager/filegui.c:371 #, c-format msgid "%.2f MB/s" msgstr "" -#: src/filemanager/filegui.c:377 +#: src/filemanager/filegui.c:375 #, c-format msgid "%.2f KB/s" msgstr "" -#: src/filemanager/filegui.c:381 +#: src/filemanager/filegui.c:379 #, c-format msgid "%ld B/s" msgstr "" -#: src/filemanager/filegui.c:424 +#: src/filemanager/filegui.c:422 msgid "Target file already exists!" msgstr "" -#: src/filemanager/filegui.c:428 +#: src/filemanager/filegui.c:426 #, c-format msgid "New : %s, size %s" msgstr "" -#: src/filemanager/filegui.c:430 +#: src/filemanager/filegui.c:428 #, c-format msgid "Existing: %s, size %s" msgstr "" -#: src/filemanager/filegui.c:432 +#: src/filemanager/filegui.c:430 msgid "Overwrite this target?" msgstr "" -#: src/filemanager/filegui.c:438 src/filemanager/hotlist.c:195 +#: src/filemanager/filegui.c:436 src/filemanager/hotlist.c:195 msgid "A&ppend" msgstr "" -#: src/filemanager/filegui.c:440 +#: src/filemanager/filegui.c:438 msgid "&Reget" msgstr "" -#: src/filemanager/filegui.c:442 +#: src/filemanager/filegui.c:440 msgid "Overwrite all targets?" msgstr "" -#: src/filemanager/filegui.c:446 +#: src/filemanager/filegui.c:444 msgid "&Update" msgstr "" -#: src/filemanager/filegui.c:450 +#: src/filemanager/filegui.c:448 msgid "If &size differs" msgstr "" -#: src/filemanager/filegui.c:473 +#: src/filemanager/filegui.c:471 msgid "File exists" msgstr "" -#: src/filemanager/filegui.c:475 +#: src/filemanager/filegui.c:473 msgid "Background process: File exists" msgstr "" -#: src/filemanager/filegui.c:942 +#: src/filemanager/filegui.c:940 #, c-format msgid "Files processed: %zu/%zu" msgstr "" -#: src/filemanager/filegui.c:944 +#: src/filemanager/filegui.c:942 #, c-format msgid "Files processed: %zu" msgstr "" -#: src/filemanager/filegui.c:991 +#: src/filemanager/filegui.c:989 #, c-format msgid "Time: %s %s" msgstr "" -#: src/filemanager/filegui.c:996 +#: src/filemanager/filegui.c:994 #, c-format msgid "Time: %s %s (%s)" msgstr "" -#: src/filemanager/filegui.c:1003 +#: src/filemanager/filegui.c:1001 #, c-format msgid "Time: %s" msgstr "" -#: src/filemanager/filegui.c:1007 +#: src/filemanager/filegui.c:1005 #, c-format msgid "Time: %s (%s)" msgstr "" -#: src/filemanager/filegui.c:1018 +#: src/filemanager/filegui.c:1016 #, c-format msgid " Total: %s " msgstr "" -#: src/filemanager/filegui.c:1022 +#: src/filemanager/filegui.c:1020 #, c-format msgid " Total: %s/%s " msgstr "" -#: src/filemanager/filegui.c:1048 +#: src/filemanager/filegui.c:1046 msgid "Source" msgstr "" -#: src/filemanager/filegui.c:1073 +#: src/filemanager/filegui.c:1071 msgid "Target" msgstr "" -#: src/filemanager/filegui.c:1097 +#: src/filemanager/filegui.c:1095 msgid "Deleting" msgstr "" -#: src/filemanager/filegui.c:1241 src/filemanager/find.c:580 +#: src/filemanager/filegui.c:1239 src/filemanager/find.c:581 #: src/filemanager/panel.c:2531 msgid "&Using shell patterns" msgstr "" -#: src/filemanager/filegui.c:1243 +#: src/filemanager/filegui.c:1241 msgid "to:" msgstr "" -#: src/filemanager/filegui.c:1247 +#: src/filemanager/filegui.c:1245 msgid "Follow &links" msgstr "" -#: src/filemanager/filegui.c:1248 +#: src/filemanager/filegui.c:1246 msgid "Preserve &attributes" msgstr "" -#: src/filemanager/filegui.c:1250 +#: src/filemanager/filegui.c:1248 msgid "Di&ve into subdir if exists" msgstr "" -#: src/filemanager/filegui.c:1251 +#: src/filemanager/filegui.c:1249 msgid "&Stable symlinks" msgstr "" -#: src/filemanager/filegui.c:1256 +#: src/filemanager/filegui.c:1254 msgid "&Background" msgstr "" -#: src/filemanager/filegui.c:1310 +#: src/filemanager/filegui.c:1309 #, c-format msgid "Invalid source pattern '%s'" msgstr "" -#: src/filemanager/find.c:189 +#: src/filemanager/find.c:190 msgid "&Chdir" msgstr "" -#: src/filemanager/find.c:190 +#: src/filemanager/find.c:191 msgid "&Again" msgstr "" -#: src/filemanager/find.c:195 src/filemanager/panelize.c:137 +#: src/filemanager/find.c:196 src/filemanager/panelize.c:137 msgid "Pane&lize" msgstr "" -#: src/filemanager/find.c:196 +#: src/filemanager/find.c:197 msgid "&View - F3" msgstr "" -#: src/filemanager/find.c:197 +#: src/filemanager/find.c:198 msgid "&Edit - F4" msgstr "" -#: src/filemanager/find.c:374 +#: src/filemanager/find.c:375 #, c-format msgid "Found: %lu" msgstr "" -#: src/filemanager/find.c:509 src/filemanager/find.c:520 +#: src/filemanager/find.c:508 src/filemanager/find.c:518 msgid "Malformed regular expression" msgstr "" -#: src/filemanager/find.c:578 +#: src/filemanager/find.c:579 msgid "File name:" msgstr "" -#: src/filemanager/find.c:579 +#: src/filemanager/find.c:580 msgid "&Find recursively" msgstr "" -#: src/filemanager/find.c:585 +#: src/filemanager/find.c:586 msgid "S&kip hidden" msgstr "" -#: src/filemanager/find.c:588 +#: src/filemanager/find.c:589 msgid "Content:" msgstr "" -#: src/filemanager/find.c:589 +#: src/filemanager/find.c:590 msgid "Sea&rch for content" msgstr "" -#: src/filemanager/find.c:591 +#: src/filemanager/find.c:592 msgid "Case sens&itive" msgstr "" -#: src/filemanager/find.c:593 +#: src/filemanager/find.c:594 msgid "A&ll charsets" msgstr "" -#: src/filemanager/find.c:596 +#: src/filemanager/find.c:597 msgid "Fir&st hit" msgstr "" -#: src/filemanager/find.c:598 src/filemanager/midnight.c:200 +#: src/filemanager/find.c:599 src/filemanager/midnight.c:200 msgid "&Tree" msgstr "" -#: src/filemanager/find.c:672 src/filemanager/find.c:1627 +#: src/filemanager/find.c:673 msgid "Find File" msgstr "" -#: src/filemanager/find.c:679 +#: src/filemanager/find.c:680 msgid "Start at:" msgstr "" -#: src/filemanager/find.c:688 +#: src/filemanager/find.c:689 msgid "Ena&ble ignore directories:" msgstr "" -#: src/filemanager/find.c:1032 src/filemanager/find.c:1125 +#: src/filemanager/find.c:1033 src/filemanager/find.c:1126 #, c-format msgid "Grepping in %s" msgstr "" -#: src/filemanager/find.c:1307 +#: src/filemanager/find.c:1308 msgid "Finished" msgstr "" -#: src/filemanager/find.c:1313 +#: src/filemanager/find.c:1314 #, c-format msgid "Finished (ignored %zu directory)" msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" -#: src/filemanager/find.c:1561 src/filemanager/find.c:1641 +#: src/filemanager/find.c:1510 +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#: src/filemanager/find.c:1513 +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + +#: src/filemanager/find.c:1596 src/filemanager/find.c:1676 msgid "Searching" msgstr "" @@ -4751,23 +4761,23 @@ msgid "" "%s" msgstr "" -#: src/subshell/common.c:419 +#: src/subshell/common.c:433 msgid "" "GNU Midnight Commander is already\n" "running on this terminal.\n" "Subshell support will be disabled." msgstr "" -#: src/subshell/common.c:1058 +#: src/subshell/common.c:1087 #, c-format msgid "Cannot open named pipe %s\n" msgstr "" -#: src/subshell/common.c:1247 +#: src/subshell/common.c:1276 msgid "The shell is still active. Quit anyway?" msgstr "" -#: src/subshell/common.c:1349 +#: src/subshell/common.c:1378 #, c-format msgid "Warning: Cannot change to %s.\n" msgstr "" @@ -4925,21 +4935,21 @@ msgstr "" msgid "User menu" msgstr "" -#: src/vfs/cpio/cpio.c:224 src/vfs/cpio/cpio.c:251 +#: src/vfs/cpio/cpio.c:235 src/vfs/cpio/cpio.c:258 #, c-format msgid "" "Cannot open cpio archive\n" "%s" msgstr "" -#: src/vfs/cpio/cpio.c:328 +#: src/vfs/cpio/cpio.c:335 #, c-format msgid "" "Premature end of cpio archive\n" "%s" msgstr "" -#: src/vfs/cpio/cpio.c:417 +#: src/vfs/cpio/cpio.c:424 #, c-format msgid "" "Inconsistent hardlinks of\n" @@ -4948,265 +4958,265 @@ msgid "" "%s" msgstr "" -#: src/vfs/cpio/cpio.c:458 +#: src/vfs/cpio/cpio.c:465 #, c-format msgid "%s contains duplicate entries! Skipping!" msgstr "" -#: src/vfs/cpio/cpio.c:568 src/vfs/cpio/cpio.c:634 src/vfs/cpio/cpio.c:640 -#: src/vfs/cpio/cpio.c:709 src/vfs/cpio/cpio.c:719 +#: src/vfs/cpio/cpio.c:575 src/vfs/cpio/cpio.c:641 src/vfs/cpio/cpio.c:647 +#: src/vfs/cpio/cpio.c:716 src/vfs/cpio/cpio.c:726 #, c-format msgid "" "Corrupted cpio header encountered in\n" "%s" msgstr "" -#: src/vfs/cpio/cpio.c:783 +#: src/vfs/cpio/cpio.c:790 #, c-format msgid "" "Unexpected end of file\n" "%s" msgstr "" -#: src/vfs/extfs/extfs.c:509 +#: src/vfs/extfs/extfs.c:529 #, c-format msgid "" "Cannot open %s archive\n" "%s" msgstr "" -#: src/vfs/extfs/extfs.c:551 src/vfs/extfs/extfs.c:572 -#: src/vfs/extfs/extfs.c:628 +#: src/vfs/extfs/extfs.c:571 src/vfs/extfs/extfs.c:592 +#: src/vfs/extfs/extfs.c:648 msgid "Inconsistent extfs archive" msgstr "" -#: src/vfs/extfs/extfs.c:1575 +#: src/vfs/extfs/extfs.c:1552 #, c-format msgid "Warning: cannot open %s directory\n" msgstr "" -#: src/vfs/fish/fish.c:363 +#: src/vfs/fish/fish.c:382 #, c-format msgid "fish: Disconnecting from %s" msgstr "" -#: src/vfs/fish/fish.c:539 +#: src/vfs/fish/fish.c:556 msgid "fish: Waiting for initial line..." msgstr "" -#: src/vfs/fish/fish.c:549 +#: src/vfs/fish/fish.c:566 msgid "Sorry, we cannot do password authenticated connections for now." msgstr "" -#: src/vfs/fish/fish.c:557 +#: src/vfs/fish/fish.c:574 #, c-format msgid "fish: Password is required for %s" msgstr "" -#: src/vfs/fish/fish.c:565 +#: src/vfs/fish/fish.c:582 msgid "fish: Sending password..." msgstr "" -#: src/vfs/fish/fish.c:602 +#: src/vfs/fish/fish.c:619 msgid "fish: Sending initial line..." msgstr "" -#: src/vfs/fish/fish.c:613 +#: src/vfs/fish/fish.c:630 msgid "fish: Handshaking version..." msgstr "" -#: src/vfs/fish/fish.c:624 +#: src/vfs/fish/fish.c:641 msgid "fish: Getting host info..." msgstr "" -#: src/vfs/fish/fish.c:747 +#: src/vfs/fish/fish.c:763 #, c-format msgid "fish: Reading directory %s..." msgstr "" -#: src/vfs/fish/fish.c:931 src/vfs/ftpfs/ftpfs.c:1808 -#: src/vfs/undelfs/undelfs.c:387 +#: src/vfs/fish/fish.c:947 src/vfs/ftpfs/ftpfs.c:1822 +#: src/vfs/undelfs/undelfs.c:391 #, c-format msgid "%s: done." msgstr "" -#: src/vfs/fish/fish.c:938 src/vfs/ftpfs/ftpfs.c:1756 -#: src/vfs/undelfs/undelfs.c:390 +#: src/vfs/fish/fish.c:954 src/vfs/ftpfs/ftpfs.c:1770 +#: src/vfs/undelfs/undelfs.c:394 #, c-format msgid "%s: failure" msgstr "" -#: src/vfs/fish/fish.c:995 +#: src/vfs/fish/fish.c:1011 #, c-format msgid "fish: store %s: sending command..." msgstr "" -#: src/vfs/fish/fish.c:1017 +#: src/vfs/fish/fish.c:1033 msgid "fish: Local read failed, sending zeros" msgstr "" -#: src/vfs/fish/fish.c:1036 +#: src/vfs/fish/fish.c:1052 msgid "fish: storing file" msgstr "" -#: src/vfs/fish/fish.c:1111 +#: src/vfs/fish/fish.c:1122 msgid "Aborting transfer..." msgstr "" -#: src/vfs/fish/fish.c:1127 +#: src/vfs/fish/fish.c:1138 msgid "Error reported after abort." msgstr "" -#: src/vfs/fish/fish.c:1129 +#: src/vfs/fish/fish.c:1140 msgid "Aborted transfer would be successful." msgstr "" -#: src/vfs/ftpfs/ftpfs.c:566 +#: src/vfs/ftpfs/ftpfs.c:590 #, c-format msgid "ftpfs: Disconnecting from %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:618 +#: src/vfs/ftpfs/ftpfs.c:641 #, c-format msgid "FTP: Password required for %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:660 +#: src/vfs/ftpfs/ftpfs.c:683 msgid "ftpfs: sending login name" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:665 +#: src/vfs/ftpfs/ftpfs.c:688 msgid "ftpfs: sending user password" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:671 +#: src/vfs/ftpfs/ftpfs.c:694 #, c-format msgid "FTP: Account required for user %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:673 +#: src/vfs/ftpfs/ftpfs.c:696 msgid "Account:" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:678 +#: src/vfs/ftpfs/ftpfs.c:701 msgid "ftpfs: sending user account" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:687 +#: src/vfs/ftpfs/ftpfs.c:710 msgid "ftpfs: logged in" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:701 +#: src/vfs/ftpfs/ftpfs.c:724 #, c-format msgid "ftpfs: Login incorrect for user %s " msgstr "" -#: src/vfs/ftpfs/ftpfs.c:832 +#: src/vfs/ftpfs/ftpfs.c:855 msgid "ftpfs: Invalid host name." msgstr "" -#: src/vfs/ftpfs/ftpfs.c:881 src/vfs/ftpfs/ftpfs.c:897 +#: src/vfs/ftpfs/ftpfs.c:904 src/vfs/ftpfs/ftpfs.c:920 #, c-format msgid "ftpfs: %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:904 +#: src/vfs/ftpfs/ftpfs.c:927 #, c-format msgid "ftpfs: making connection to %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:914 +#: src/vfs/ftpfs/ftpfs.c:937 msgid "ftpfs: connection interrupted by user" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:916 +#: src/vfs/ftpfs/ftpfs.c:939 #, c-format msgid "ftpfs: connection to server failed: %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:970 +#: src/vfs/ftpfs/ftpfs.c:993 #, c-format msgid "Waiting to retry... %d (Control-G to cancel)" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1299 +#: src/vfs/ftpfs/ftpfs.c:1313 msgid "ftpfs: invalid address family" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1307 +#: src/vfs/ftpfs/ftpfs.c:1321 #, c-format msgid "ftpfs: could not create socket: %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1341 +#: src/vfs/ftpfs/ftpfs.c:1355 msgid "ftpfs: could not setup passive mode" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1453 +#: src/vfs/ftpfs/ftpfs.c:1467 msgid "ftpfs: aborting transfer." msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1456 +#: src/vfs/ftpfs/ftpfs.c:1470 #, c-format msgid "ftpfs: abort error: %s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1464 +#: src/vfs/ftpfs/ftpfs.c:1478 msgid "ftpfs: abort failed" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1595 src/vfs/ftpfs/ftpfs.c:1707 +#: src/vfs/ftpfs/ftpfs.c:1609 src/vfs/ftpfs/ftpfs.c:1721 msgid "ftpfs: CWD failed." msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1605 src/vfs/ftpfs/ftpfs.c:1613 +#: src/vfs/ftpfs/ftpfs.c:1619 src/vfs/ftpfs/ftpfs.c:1627 msgid "ftpfs: couldn't resolve symlink" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1674 +#: src/vfs/ftpfs/ftpfs.c:1688 msgid "Resolving symlink..." msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1697 +#: src/vfs/ftpfs/ftpfs.c:1711 #, c-format msgid "ftpfs: Reading FTP directory %s... %s%s" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1700 +#: src/vfs/ftpfs/ftpfs.c:1714 msgid "(strict rfc959)" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1700 +#: src/vfs/ftpfs/ftpfs.c:1714 msgid "(chdir first)" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1822 +#: src/vfs/ftpfs/ftpfs.c:1836 msgid "ftpfs: failed; nowhere to fallback to" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:1901 +#: src/vfs/ftpfs/ftpfs.c:1915 msgid "ftpfs: storing file" msgstr "" -#: src/vfs/ftpfs/ftpfs.c:2396 +#: src/vfs/ftpfs/ftpfs.c:2409 msgid "" "~/.netrc file has incorrect mode\n" "Remove password or correct mode" msgstr "" -#: src/vfs/sfs/sfs.c:435 +#: src/vfs/sfs/sfs.c:438 #, c-format msgid "%s: Warning: file %s not found\n" msgstr "" -#: src/vfs/sfs/sfs.c:464 +#: src/vfs/sfs/sfs.c:467 #, c-format msgid "" "Warning: Invalid line in %s:\n" "%s\n" msgstr "" -#: src/vfs/sfs/sfs.c:483 +#: src/vfs/sfs/sfs.c:486 #, c-format msgid "" "Warning: Invalid flag %c in %s:\n" @@ -5222,7 +5232,7 @@ msgstr "" msgid "sftp: Unable to get current user name." msgstr "" -#: src/vfs/sftpfs/connection.c:78 src/vfs/sftpfs/vfs_subclass.c:101 +#: src/vfs/sftpfs/connection.c:78 src/vfs/sftpfs/vfs_subclass.c:116 msgid "sftp: Invalid host name." msgstr "" @@ -5245,29 +5255,29 @@ msgstr "" msgid "sftp: connection to server failed: %s" msgstr "" -#: src/vfs/sftpfs/connection.c:277 +#: src/vfs/sftpfs/connection.c:270 #, c-format msgid "sftp: Enter passphrase for %s " msgstr "" -#: src/vfs/sftpfs/connection.c:282 +#: src/vfs/sftpfs/connection.c:275 msgid "sftp: Passphrase is empty." msgstr "" -#: src/vfs/sftpfs/connection.c:328 +#: src/vfs/sftpfs/connection.c:319 #, c-format msgid "sftp: Enter password for %s " msgstr "" -#: src/vfs/sftpfs/connection.c:333 +#: src/vfs/sftpfs/connection.c:324 msgid "sftp: Password is empty." msgstr "" -#: src/vfs/sftpfs/connection.c:398 +#: src/vfs/sftpfs/connection.c:387 msgid "sftp: Failure establishing SSH session" msgstr "" -#: src/vfs/sftpfs/file.c:267 +#: src/vfs/sftpfs/file.c:281 msgid "sftp: No file handler data present for reading file" msgstr "" @@ -5276,12 +5286,12 @@ msgstr "" msgid "sftp: socket error: %s" msgstr "" -#: src/vfs/sftpfs/vfs_class.c:215 +#: src/vfs/sftpfs/vfs_class.c:212 #, c-format msgid "sftp: (Ctrl-G break) Listing... %s" msgstr "" -#: src/vfs/sftpfs/vfs_class.c:217 +#: src/vfs/sftpfs/vfs_class.c:214 msgid "sftp: Listing done." msgstr "" @@ -5319,115 +5329,115 @@ msgstr "" msgid "%s renaming files\n" msgstr "" -#: src/vfs/tar/tar.c:294 src/vfs/tar/tar.c:320 +#: src/vfs/tar/tar.c:311 src/vfs/tar/tar.c:334 #, c-format msgid "" "Cannot open tar archive\n" "%s" msgstr "" -#: src/vfs/tar/tar.c:602 src/vfs/tar/tar.c:631 src/vfs/tar/tar.c:716 -#: src/vfs/tar/tar.c:725 +#: src/vfs/tar/tar.c:616 src/vfs/tar/tar.c:645 src/vfs/tar/tar.c:730 +#: src/vfs/tar/tar.c:739 msgid "Inconsistent tar archive" msgstr "" -#: src/vfs/tar/tar.c:617 +#: src/vfs/tar/tar.c:631 msgid "Unexpected EOF on archive file" msgstr "" -#: src/vfs/tar/tar.c:818 +#: src/vfs/tar/tar.c:832 #, c-format msgid "" "%s\n" "doesn't look like a tar archive." msgstr "" -#: src/vfs/undelfs/undelfs.c:129 +#: src/vfs/undelfs/undelfs.c:130 msgid "undelfs: error" msgstr "" -#: src/vfs/undelfs/undelfs.c:243 +#: src/vfs/undelfs/undelfs.c:247 msgid "not enough memory" msgstr "" -#: src/vfs/undelfs/undelfs.c:249 +#: src/vfs/undelfs/undelfs.c:253 msgid "while allocating block buffer" msgstr "" -#: src/vfs/undelfs/undelfs.c:255 +#: src/vfs/undelfs/undelfs.c:259 #, c-format msgid "open_inode_scan: %d" msgstr "" -#: src/vfs/undelfs/undelfs.c:261 +#: src/vfs/undelfs/undelfs.c:265 #, c-format msgid "while starting inode scan %d" msgstr "" -#: src/vfs/undelfs/undelfs.c:268 +#: src/vfs/undelfs/undelfs.c:272 #, c-format msgid "undelfs: loading deleted files information %d inodes" msgstr "" -#: src/vfs/undelfs/undelfs.c:283 +#: src/vfs/undelfs/undelfs.c:287 #, c-format msgid "while calling ext2_block_iterate %d" msgstr "" -#: src/vfs/undelfs/undelfs.c:296 +#: src/vfs/undelfs/undelfs.c:300 msgid "no more memory while reallocating array" msgstr "" -#: src/vfs/undelfs/undelfs.c:318 +#: src/vfs/undelfs/undelfs.c:322 #, c-format msgid "while doing inode scan %d" msgstr "" -#: src/vfs/undelfs/undelfs.c:369 +#: src/vfs/undelfs/undelfs.c:373 #, c-format msgid "Cannot open file %s" msgstr "" -#: src/vfs/undelfs/undelfs.c:372 +#: src/vfs/undelfs/undelfs.c:376 msgid "undelfs: reading inode bitmap..." msgstr "" -#: src/vfs/undelfs/undelfs.c:375 +#: src/vfs/undelfs/undelfs.c:379 #, c-format msgid "" "Cannot load inode bitmap from:\n" "%s" msgstr "" -#: src/vfs/undelfs/undelfs.c:378 +#: src/vfs/undelfs/undelfs.c:382 msgid "undelfs: reading block bitmap..." msgstr "" -#: src/vfs/undelfs/undelfs.c:381 +#: src/vfs/undelfs/undelfs.c:385 #, c-format msgid "" "Cannot load block bitmap from:\n" "%s" msgstr "" -#: src/vfs/undelfs/undelfs.c:406 +#: src/vfs/undelfs/undelfs.c:410 msgid "vfs_info is not fs!" msgstr "" -#: src/vfs/undelfs/undelfs.c:452 src/vfs/undelfs/undelfs.c:676 +#: src/vfs/undelfs/undelfs.c:456 src/vfs/undelfs/undelfs.c:680 msgid "You have to chdir to extract files first" msgstr "" -#: src/vfs/undelfs/undelfs.c:598 +#: src/vfs/undelfs/undelfs.c:602 msgid "while iterating over blocks" msgstr "" -#: src/vfs/undelfs/undelfs.c:720 +#: src/vfs/undelfs/undelfs.c:724 #, c-format msgid "Cannot open file \"%s\"" msgstr "" -#: src/vfs/undelfs/undelfs.c:814 +#: src/vfs/undelfs/undelfs.c:818 msgid "Ext2lib error" msgstr "" diff --git a/po/mn.po b/po/mn.po index d9af65e6a..4cfd0f61d 100644 --- a/po/mn.po +++ b/po/mn.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Mongolian (http://www.transifex.com/mc/mc/language/mn/)\n" @@ -2839,6 +2839,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Файл хайх" + msgid "Searching" msgstr "Хайж байна" diff --git a/po/nb.po b/po/nb.po index b623fc365..b586c2da4 100644 --- a/po/nb.po +++ b/po/nb.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Norwegian Bokmål (http://www.transifex.com/mc/mc/language/" @@ -2840,6 +2840,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Finn fil" + msgid "Searching" msgstr "Søker" diff --git a/po/nl.po b/po/nl.po index 98d170fec..d8cb07500 100644 --- a/po/nl.po +++ b/po/nl.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Dutch (http://www.transifex.com/mc/mc/language/nl/)\n" @@ -3029,6 +3029,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Klaar (%zu directorie genegeerd)" msgstr[1] "Klaar (%zu directories genegeerd)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Bestand zoeken" + msgid "Searching" msgstr "Aan het zoeken" diff --git a/po/pl.po b/po/pl.po index b7a64435b..8e344e05a 100644 --- a/po/pl.po +++ b/po/pl.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-01 15:44+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Polish (http://www.transifex.com/mc/mc/language/pl/)\n" @@ -3037,6 +3037,14 @@ msgstr[1] "Ukończono (zignorowano %zu katalogi)" msgstr[2] "Ukończono (zignorowano %zu katalogów)" msgstr[3] "Ukończono (zignorowano %zu katalogów)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Znajdź plik" + msgid "Searching" msgstr "Wyszukiwanie" diff --git a/po/pt.po b/po/pt.po index d9adf1d57..2e18448bc 100644 --- a/po/pt.po +++ b/po/pt.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 22:38+0000\n" "Last-Translator: Gilberto Jorge \n" "Language-Team: Portuguese (http://www.transifex.com/mc/mc/language/pt/)\n" @@ -3033,6 +3033,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Terminado (%zu directório ignorado)" msgstr[1] "Terminado (%zu directórios ignorados)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Procurar Ficheiro" + msgid "Searching" msgstr "A procurar" diff --git a/po/pt_BR.po b/po/pt_BR.po index e2e148976..777de5bce 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/mc/mc/language/" @@ -2965,6 +2965,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Procurar arquivo" + msgid "Searching" msgstr "Procurando" diff --git a/po/ro.po b/po/ro.po index 23e76665e..4533eff33 100644 --- a/po/ro.po +++ b/po/ro.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Romanian (http://www.transifex.com/mc/mc/language/ro/)\n" @@ -3035,6 +3035,14 @@ msgstr[0] "Finalizat (au fost ignorate %zu dosar)" msgstr[1] "Finalizat (au fost ignorate %zu dosare)" msgstr[2] "Finalizat (au fost ignorate %zu dosare)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Caută fișier" + msgid "Searching" msgstr "Caut" diff --git a/po/ru.po b/po/ru.po index 77f2f699c..4bc7f23d6 100644 --- a/po/ru.po +++ b/po/ru.po @@ -3,30 +3,25 @@ # This file is distributed under the same license as the mc package. # # Translators: -# aborodin , 2011 -# AlexL , 2015-2017 # Alex Tkachenko , 1998 -# and Alex Tkachenko , 1998 -# aborodin , 2009-2012 -# Andrew V. Samoilov , 1999,2014 -# Anton Sergeevich Chumak , 2005 -# Dimitriy Ryazantcev , 2015 # Evgeny Bulgakov , 1999 -# Ilia Maslakov , 2009 -# Mr GreyWolf, 2016 -# Mr.GreyWolf, 2016 -# NaiLi (aka jamesjames) Rootaerc , 2012 -# Piotr Drąg , 2018 # Sergey Panov , 1999 -# Simple88, 2016 -# Simple88, 2016 -# Slava Zanko , 2009,2011 +# Andrew V. Samoilov , 1999, 2014 # Valek Filippov , 2000 +# Anton Sergeevich Chumak , 2005 +# Andrew Borodin , 2011-2018 +# Ilia Maslakov , 2009 +# Slava Zanko , 2009, 2011 +# AlexL , 2015-2017 +# NaiLi (aka jamesjames) Rootaerc , 2012 +# Dimitriy Ryazantcev , 2015 +# Simple88, 2016 +# Piotr Drąg , 2018 msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Russian (http://www.transifex.com/mc/mc/language/ru/)\n" @@ -3048,6 +3043,14 @@ msgstr[1] "Завершено (пропущено %zu каталога)" msgstr[2] "Завершено (пропущено %zu каталогов)" msgstr[3] "Завершено (пропущено %zu каталогов)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "Поиск файла: \"%s\". Содержимое: \"%s\"" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "Поиск файла: \"%s\"" + msgid "Searching" msgstr "Ищем" diff --git a/po/sk.po b/po/sk.po index a62e44268..c6faff34e 100644 --- a/po/sk.po +++ b/po/sk.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Slovak (http://www.transifex.com/mc/mc/language/sk/)\n" @@ -3024,6 +3024,14 @@ msgstr[1] "" msgstr[2] "" msgstr[3] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Nájsť súbor" + msgid "Searching" msgstr "Hľadá sa" diff --git a/po/sl.po b/po/sl.po index 467420a8d..0bbc319ca 100644 --- a/po/sl.po +++ b/po/sl.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Slovenian (http://www.transifex.com/mc/mc/language/sl/)\n" @@ -2851,6 +2851,14 @@ msgstr[1] "" msgstr[2] "" msgstr[3] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Poišči datoteko" + msgid "Searching" msgstr "Iščem" diff --git a/po/sr.po b/po/sr.po index afcc6615d..3cd5f801d 100644 --- a/po/sr.po +++ b/po/sr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Serbian (http://www.transifex.com/mc/mc/language/sr/)\n" @@ -3013,6 +3013,14 @@ msgstr[0] "" msgstr[1] "" msgstr[2] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Нађите датотеку" + msgid "Searching" msgstr "Тражим" diff --git a/po/sv.po b/po/sv.po index 9c221c2f8..21a03a129 100644 --- a/po/sv.po +++ b/po/sv.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Swedish (http://www.transifex.com/mc/mc/language/sv/)\n" @@ -3032,6 +3032,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "Klar (ignorerade %zu katalog)" msgstr[1] "Klar (ignorerade %zu kataloger)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Sök Fil" + msgid "Searching" msgstr "Söker" diff --git a/po/szl.po b/po/szl.po index 19974cb4f..eceb9a68f 100644 --- a/po/szl.po +++ b/po/szl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Silesian (http://www.transifex.com/mc/mc/language/szl/)\n" @@ -2838,6 +2838,14 @@ msgstr[0] "" msgstr[1] "" msgstr[2] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/ta.po b/po/ta.po index 8fd0b7a21..16da28e00 100644 --- a/po/ta.po +++ b/po/ta.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Tamil (http://www.transifex.com/mc/mc/language/ta/)\n" @@ -2837,6 +2837,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/te.po b/po/te.po index 24415daf9..945bb4d40 100644 --- a/po/te.po +++ b/po/te.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Telugu (http://www.transifex.com/mc/mc/language/te/)\n" @@ -2836,6 +2836,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, c-format +msgid "Find File: \"%s\"" +msgstr "" + msgid "Searching" msgstr "" diff --git a/po/tr.po b/po/tr.po index f98548bcb..f4d162aee 100644 --- a/po/tr.po +++ b/po/tr.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Turkish (http://www.transifex.com/mc/mc/language/tr/)\n" @@ -3027,6 +3027,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Dosyayı bul" + msgid "Searching" msgstr "Aranıyor" diff --git a/po/uk.po b/po/uk.po index dedc0f8d4..d7a8a3f20 100644 --- a/po/uk.po +++ b/po/uk.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Ukrainian (http://www.transifex.com/mc/mc/language/uk/)\n" @@ -3004,6 +3004,14 @@ msgstr[1] "Завершено (ігноровано %zu каталогів)" msgstr[2] "Завершено (ігноровано %zu каталогів)" msgstr[3] "Завершено (ігноровано %zu каталогів)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Знайти файл" + msgid "Searching" msgstr "Виконується пошук" diff --git a/po/vi.po b/po/vi.po index e4237f201..1f9bc458c 100644 --- a/po/vi.po +++ b/po/vi.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Vietnamese (http://www.transifex.com/mc/mc/language/vi/)\n" @@ -2838,6 +2838,14 @@ msgid "Finished (ignored %zu directory)" msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Tìm tập tin" + msgid "Searching" msgstr "Tìm" diff --git a/po/wa.po b/po/wa.po index 612d1e47a..7e2d12de4 100644 --- a/po/wa.po +++ b/po/wa.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Walloon (http://www.transifex.com/mc/mc/language/wa/)\n" @@ -2837,6 +2837,14 @@ msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" msgstr[1] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "Trover Fitchî" + msgid "Searching" msgstr "Dji cwîr" diff --git a/po/zh_CN.po b/po/zh_CN.po index 7aa86f9ba..083168d20 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -17,7 +17,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-05-10 15:41+0000\n" "Last-Translator: Mingcong Bai \n" "Language-Team: Chinese (China) (http://www.transifex.com/mc/mc/language/" @@ -3026,6 +3026,14 @@ msgid "Finished (ignored %zu directory)" msgid_plural "Finished (ignored %zu directories)" msgstr[0] "完成 (忽略 %zu 个目录)" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "搜索文件" + msgid "Searching" msgstr "正在搜索" diff --git a/po/zh_TW.po b/po/zh_TW.po index e69c1f1a3..a389ee288 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Midnight Commander\n" "Report-Msgid-Bugs-To: http://www.midnight-commander.org/\n" -"POT-Creation-Date: 2018-05-27 21:58+0200\n" +"POT-Creation-Date: 2018-09-09 19:12+0300\n" "PO-Revision-Date: 2018-04-30 12:37+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Chinese (Taiwan) (http://www.transifex.com/mc/mc/language/" @@ -2839,6 +2839,14 @@ msgid "Finished (ignored %zu directory)" msgid_plural "Finished (ignored %zu directories)" msgstr[0] "" +#, c-format +msgid "Find File: \"%s\". Content: \"%s\"" +msgstr "" + +#, fuzzy, c-format +msgid "Find File: \"%s\"" +msgstr "尋找檔案" + msgid "Searching" msgstr "搜尋中"