Merge branch '3997_cleanup'

* 3997_cleanup:
  Do not include <sys/select> globally via "lib/global.h".
  (mc_symlink): test vpath2 before use.
  lib/vfs/interface.c: fix coding style.
  (display_bits_box): use tty_display_8bit().
  (panel_options_box): don't apply integer value to boolean variable.
  (edit_files): fix shadow of variable declaration.
  mcviewer: clarify of HAVE_CHARSET usage.
  Replace [] in AS_HELP_STRING.
  (setup_panels): fix origin and size of panels.
  (vfs_stamp_compare): fix NULL dereference.
  (ftpfs_dir_load): minor refactoring.
  Make VFS faster a bit.
  (vfs_s_normalize_filename_leading_spaces): minor refactoring.
  (history_show): fix order of history items.
  urar extfs: don't start path with ./ in file list.
  Ticket #3997: code clean up before 4.8.24 release.
This commit is contained in:
Andrew Borodin 2019-09-29 15:19:10 +03:00
commit 994c6a3c18
24 changed files with 167 additions and 149 deletions

View File

@ -58,10 +58,6 @@
#endif /* !O_NDELAY */ #endif /* !O_NDELAY */
#endif /* !O_NONBLOCK */ #endif /* !O_NONBLOCK */
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#if defined(__QNX__) && !defined(__QNXNTO__) #if defined(__QNX__) && !defined(__QNXNTO__)
/* exec*() from <process.h> */ /* exec*() from <process.h> */
#include <unix.h> #include <unix.h>

View File

@ -40,9 +40,13 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#else
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#endif
#include "lib/global.h" #include "lib/global.h"

View File

@ -32,8 +32,13 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#else
#include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#endif
#include "lib/global.h" #include "lib/global.h"
#include "lib/util.h" /* is_printable() */ #include "lib/util.h" /* is_printable() */

View File

@ -58,10 +58,14 @@
#include <config.h> #include <config.h>
#include <errno.h> #include <errno.h>
#include <time.h>
#include <sys/time.h> /* gettimeofday() */
#include <inttypes.h> /* uintmax_t */ #include <inttypes.h> /* uintmax_t */
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#include <sys/time.h> /* gettimeofday() */
#include <sys/types.h>
#include <unistd.h>
#include "lib/global.h" #include "lib/global.h"
@ -196,7 +200,7 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
for (pseg = 0; path[pseg] != '\0' && !IS_PATH_SEP (path[pseg]); pseg++) for (pseg = 0; path[pseg] != '\0' && !IS_PATH_SEP (path[pseg]); pseg++)
; ;
for (iter = root->subdir; iter != NULL; iter = g_list_next (iter)) for (iter = g_queue_peek_head_link (root->subdir); iter != NULL; iter = g_list_next (iter))
{ {
ent = VFS_ENTRY (iter->data); ent = VFS_ENTRY (iter->data);
if (strlen (ent->name) == pseg && strncmp (ent->name, path, pseg) == 0) if (strlen (ent->name) == pseg && strncmp (ent->name, path, pseg) == 0)
@ -259,7 +263,7 @@ vfs_s_find_entry_linear (struct vfs_class *me, struct vfs_s_inode *root,
return ent; return ent;
} }
iter = g_list_find_custom (root->subdir, path, (GCompareFunc) vfs_s_entry_compare); iter = g_queue_find_custom (root->subdir, path, (GCompareFunc) vfs_s_entry_compare);
ent = iter != NULL ? VFS_ENTRY (iter->data) : NULL; ent = iter != NULL ? VFS_ENTRY (iter->data) : NULL;
if (ent != NULL && !VFS_SUBCLASS (me)->dir_uptodate (me, ent->ino)) if (ent != NULL && !VFS_SUBCLASS (me)->dir_uptodate (me, ent->ino))
@ -286,7 +290,7 @@ vfs_s_find_entry_linear (struct vfs_class *me, struct vfs_s_inode *root,
vfs_s_insert_entry (me, root, ent); vfs_s_insert_entry (me, root, ent);
iter = g_list_find_custom (root->subdir, path, (GCompareFunc) vfs_s_entry_compare); iter = g_queue_find_custom (root->subdir, path, (GCompareFunc) vfs_s_entry_compare);
ent = iter != NULL ? VFS_ENTRY (iter->data) : NULL; ent = iter != NULL ? VFS_ENTRY (iter->data) : NULL;
} }
if (ent == NULL) if (ent == NULL)
@ -441,7 +445,7 @@ vfs_s_opendir (const vfs_path_t * vpath)
} }
#endif #endif
info = g_new (struct dirhandle, 1); info = g_new (struct dirhandle, 1);
info->cur = dir->subdir; info->cur = g_queue_peek_head_link (dir->subdir);
info->dir = dir; info->dir = dir;
return info; return info;
@ -888,6 +892,7 @@ vfs_s_new_inode (struct vfs_class *me, struct vfs_s_super *super, struct stat *i
if (initstat != NULL) if (initstat != NULL)
ino->st = *initstat; ino->st = *initstat;
ino->super = super; ino->super = super;
ino->subdir = g_queue_new ();
ino->st.st_nlink = 0; ino->st.st_nlink = 0;
ino->st.st_ino = VFS_SUBCLASS (me)->inode_counter++; ino->st.st_ino = VFS_SUBCLASS (me)->inode_counter++;
ino->st.st_dev = VFS_SUBCLASS (me)->rdev; ino->st.st_dev = VFS_SUBCLASS (me)->rdev;
@ -914,8 +919,16 @@ vfs_s_free_inode (struct vfs_class *me, struct vfs_s_inode *ino)
return; return;
} }
while (ino->subdir != NULL) while (g_queue_get_length (ino->subdir) != 0)
vfs_s_free_entry (me, VFS_ENTRY (ino->subdir->data)); {
struct vfs_s_entry *entry;
entry = VFS_ENTRY (g_queue_peek_head (ino->subdir));
vfs_s_free_entry (me, entry);
}
g_queue_free (ino->subdir);
ino->subdir = NULL;
CALL (free_inode) (me, ino); CALL (free_inode) (me, ino);
g_free (ino->linkname); g_free (ino->linkname);
@ -951,7 +964,7 @@ void
vfs_s_free_entry (struct vfs_class *me, struct vfs_s_entry *ent) vfs_s_free_entry (struct vfs_class *me, struct vfs_s_entry *ent)
{ {
if (ent->dir != NULL) if (ent->dir != NULL)
ent->dir->subdir = g_list_remove (ent->dir->subdir, ent); g_queue_remove (ent->dir->subdir, ent);
MC_PTR_FREE (ent->name); MC_PTR_FREE (ent->name);
@ -974,7 +987,7 @@ vfs_s_insert_entry (struct vfs_class *me, struct vfs_s_inode *dir, struct vfs_s_
ent->dir = dir; ent->dir = dir;
ent->ino->st.st_nlink++; ent->ino->st.st_nlink++;
dir->subdir = g_list_append (dir->subdir, ent); g_queue_push_tail (dir->subdir, ent);
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -1708,20 +1721,22 @@ vfs_s_normalize_filename_leading_spaces (struct vfs_s_inode *root_inode, size_t
{ {
GList *iter; GList *iter;
for (iter = root_inode->subdir; iter != NULL; iter = g_list_next (iter)) for (iter = g_queue_peek_head_link (root_inode->subdir); iter != NULL;
iter = g_list_next (iter))
{ {
struct vfs_s_entry *entry = VFS_ENTRY (iter->data); struct vfs_s_entry *entry = VFS_ENTRY (iter->data);
if ((size_t) entry->ino->data_offset > final_num_spaces) if ((size_t) entry->ino->data_offset > final_num_spaces)
{ {
char *source_name = entry->name; char *source_name, *spacer;
char *spacer;
source_name = entry->name;
spacer = g_strnfill (entry->ino->data_offset - final_num_spaces, ' '); spacer = g_strnfill (entry->ino->data_offset - final_num_spaces, ' ');
entry->name = g_strdup_printf ("%s%s", spacer, source_name); entry->name = g_strconcat (spacer, source_name, (char *) NULL);
g_free (spacer); g_free (spacer);
g_free (source_name); g_free (source_name);
} }
entry->ino->data_offset = -1; entry->ino->data_offset = -1;
} }
} }

View File

@ -127,7 +127,7 @@ vfs_stamp_compare (gconstpointer a, gconstpointer b)
const struct vfs_stamping *vsa = (const struct vfs_stamping *) a; const struct vfs_stamping *vsa = (const struct vfs_stamping *) a;
const struct vfs_stamping *vsb = (const struct vfs_stamping *) b; const struct vfs_stamping *vsb = (const struct vfs_stamping *) b;
return (vsa->v == vsb->v && vsa->id == vsb->id) ? 0 : 1; return (vsa == NULL || vsb == NULL || (vsa->v == vsb->v && vsa->id == vsb->id)) ? 0 : 1;
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -163,7 +163,7 @@ vfs_stamp (struct vfs_class *v, vfsid id)
gboolean ret = FALSE; gboolean ret = FALSE;
stamp = g_slist_find_custom (stamps, &what, vfs_stamp_compare); stamp = g_slist_find_custom (stamps, &what, vfs_stamp_compare);
if (stamp != NULL) if (stamp != NULL && stamp->data != NULL)
{ {
gettimeofday (&(VFS_STAMPING (stamp->data)->time), NULL); gettimeofday (&(VFS_STAMPING (stamp->data)->time), NULL);
ret = TRUE; ret = TRUE;

View File

@ -178,7 +178,7 @@ mc_def_ungetlocalcopy (const vfs_path_t * filename_vpath,
if (fdin != -1) if (fdin != -1)
close (fdin); close (fdin);
unlink (local); unlink (local);
return -1; return (-1);
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -193,12 +193,13 @@ mc_open (const vfs_path_t * vpath, int flags, ...)
const vfs_path_element_t *path_element; const vfs_path_element_t *path_element;
if (vpath == NULL) if (vpath == NULL)
return -1; return (-1);
/* Get the mode flag */ /* Get the mode flag */
if (flags & O_CREAT) if ((flags & O_CREAT) != 0)
{ {
va_list ap; va_list ap;
va_start (ap, flags); va_start (ap, flags);
/* We have to use PROMOTED_MODE_T instead of mode_t. Doing 'va_arg (ap, mode_t)' /* We have to use PROMOTED_MODE_T instead of mode_t. Doing 'va_arg (ap, mode_t)'
* fails on systems where 'mode_t' is smaller than 'int' because of C's "default * fails on systems where 'mode_t' is smaller than 'int' because of C's "default
@ -211,6 +212,7 @@ mc_open (const vfs_path_t * vpath, int flags, ...)
if (vfs_path_element_valid (path_element) && path_element->class->open != NULL) if (vfs_path_element_valid (path_element) && path_element->class->open != NULL)
{ {
void *info; void *info;
/* open must be supported */ /* open must be supported */
info = path_element->class->open (vpath, flags, mode); info = path_element->class->open (vpath, flags, mode);
if (info == NULL) if (info == NULL)
@ -235,13 +237,11 @@ int mc_##name inarg \
const vfs_path_element_t *path_element; \ const vfs_path_element_t *path_element; \
\ \
if (vpath == NULL) \ if (vpath == NULL) \
return -1; \ return (-1); \
\ \
path_element = vfs_path_get_by_index (vpath, -1); \ path_element = vfs_path_get_by_index (vpath, -1); \
if (!vfs_path_element_valid (path_element)) \ if (!vfs_path_element_valid (path_element)) \
{ \ return (-1); \
return -1; \
} \
\ \
result = path_element->class->name != NULL ? path_element->class->name callarg : -1; \ result = path_element->class->name != NULL ? path_element->class->name callarg : -1; \
if (result == -1) \ if (result == -1) \
@ -267,10 +267,7 @@ mc_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
{ {
int result = -1; int result = -1;
if (vpath1 == NULL) if (vpath1 != NULL && vpath2 != NULL)
return -1;
if (vpath1 != NULL)
{ {
const vfs_path_element_t *path_element; const vfs_path_element_t *path_element;
@ -300,11 +297,14 @@ ssize_t mc_##name (int handle, C void *buf, size_t count) \
struct vfs_class *vfs; \ struct vfs_class *vfs; \
void *fsinfo = NULL; \ void *fsinfo = NULL; \
int result; \ int result; \
\
if (handle == -1) \ if (handle == -1) \
return -1; \ return (-1); \
\
vfs = vfs_class_find_by_handle (handle, &fsinfo); \ vfs = vfs_class_find_by_handle (handle, &fsinfo); \
if (vfs == NULL) \ if (vfs == NULL) \
return -1; \ return (-1); \
\
result = vfs->name != NULL ? vfs->name (fsinfo, buf, count) : -1; \ result = vfs->name != NULL ? vfs->name (fsinfo, buf, count) : -1; \
if (result == -1) \ if (result == -1) \
errno = vfs->name != NULL ? vfs_ferrno (vfs) : E_NOTSUPP; \ errno = vfs->name != NULL ? vfs_ferrno (vfs) : E_NOTSUPP; \
@ -328,7 +328,7 @@ int mc_##name (const vfs_path_t *vpath1, const vfs_path_t *vpath2) \
const vfs_path_element_t *path_element2; \ const vfs_path_element_t *path_element2; \
\ \
if (vpath1 == NULL || vpath2 == NULL) \ if (vpath1 == NULL || vpath2 == NULL) \
return -1; \ return (-1); \
\ \
path_element1 = vfs_path_get_by_index (vpath1, (-1)); \ path_element1 = vfs_path_get_by_index (vpath1, (-1)); \
path_element2 = vfs_path_get_by_index (vpath2, (-1)); \ path_element2 = vfs_path_get_by_index (vpath2, (-1)); \
@ -337,12 +337,11 @@ int mc_##name (const vfs_path_t *vpath1, const vfs_path_t *vpath2) \
path_element1->class != path_element2->class) \ path_element1->class != path_element2->class) \
{ \ { \
errno = EXDEV; \ errno = EXDEV; \
return -1; \ return (-1); \
}\ } \
\ \
result = path_element1->class->name != NULL \ result = path_element1->class->name != NULL \
? path_element1->class->name (vpath1, vpath2) \ ? path_element1->class->name (vpath1, vpath2) : -1; \
: -1; \
if (result == -1) \ if (result == -1) \
errno = path_element1->class->name != NULL ? vfs_ferrno (path_element1->class) : E_NOTSUPP; \ errno = path_element1->class->name != NULL ? vfs_ferrno (path_element1->class) : E_NOTSUPP; \
return result; \ return result; \
@ -396,18 +395,18 @@ mc_close (int handle)
int result; int result;
if (handle == -1) if (handle == -1)
return -1; return (-1);
vfs = vfs_class_find_by_handle (handle, &fsinfo); vfs = vfs_class_find_by_handle (handle, &fsinfo);
if (vfs == NULL || fsinfo == NULL) if (vfs == NULL || fsinfo == NULL)
return -1; return (-1);
if (handle < 3) if (handle < 3)
return close (handle); return close (handle);
if (!vfs->close) if (vfs->close == NULL)
vfs_die ("VFS must support close.\n"); vfs_die ("VFS must support close.\n");
result = (*vfs->close) (fsinfo); result = vfs->close (fsinfo);
vfs_free_handle (handle); vfs_free_handle (handle);
if (result == -1) if (result == -1)
errno = vfs_ferrno (vfs); errno = vfs_ferrno (vfs);
@ -428,15 +427,13 @@ mc_opendir (const vfs_path_t * vpath)
return NULL; return NULL;
path_element = (vfs_path_element_t *) vfs_path_get_by_index (vpath, -1); path_element = (vfs_path_element_t *) vfs_path_get_by_index (vpath, -1);
if (!vfs_path_element_valid (path_element)) if (!vfs_path_element_valid (path_element))
{ {
errno = E_NOTSUPP; errno = E_NOTSUPP;
return NULL; return NULL;
} }
info = path_element->class->opendir ? (*path_element->class->opendir) (vpath) : NULL; info = path_element->class->opendir ? path_element->class->opendir (vpath) : NULL;
if (info == NULL) if (info == NULL)
{ {
errno = path_element->class->opendir ? vfs_ferrno (path_element->class) : E_NOTSUPP; errno = path_element->class->opendir ? vfs_ferrno (path_element->class) : E_NOTSUPP;
@ -470,7 +467,7 @@ mc_readdir (DIR * dirp)
struct dirent *entry = NULL; struct dirent *entry = NULL;
vfs_path_element_t *vfs_path_element; vfs_path_element_t *vfs_path_element;
if (!mc_readdir_result) if (mc_readdir_result == NULL)
{ {
/* We can't just allocate struct dirent as (see man dirent.h) /* We can't just allocate struct dirent as (see man dirent.h)
* struct dirent has VERY nonnaive semantics of allocating * struct dirent has VERY nonnaive semantics of allocating
@ -485,11 +482,12 @@ mc_readdir (DIR * dirp)
mc_readdir_result = (struct dirent *) g_malloc (sizeof (struct dirent) + MAXNAMLEN + 1); mc_readdir_result = (struct dirent *) g_malloc (sizeof (struct dirent) + MAXNAMLEN + 1);
} }
if (!dirp) if (dirp == NULL)
{ {
errno = EFAULT; errno = EFAULT;
return NULL; return NULL;
} }
handle = *(int *) dirp; handle = *(int *) dirp;
vfs = vfs_class_find_by_handle (handle, &fsinfo); vfs = vfs_class_find_by_handle (handle, &fsinfo);
@ -497,9 +495,9 @@ mc_readdir (DIR * dirp)
return NULL; return NULL;
vfs_path_element = (vfs_path_element_t *) fsinfo; vfs_path_element = (vfs_path_element_t *) fsinfo;
if (vfs->readdir) if (vfs->readdir != NULL)
{ {
entry = (*vfs->readdir) (vfs_path_element->dir.info); entry = vfs->readdir (vfs_path_element->dir.info);
if (entry == NULL) if (entry == NULL)
return NULL; return NULL;
@ -562,13 +560,12 @@ mc_stat (const vfs_path_t * vpath, struct stat *buf)
const vfs_path_element_t *path_element; const vfs_path_element_t *path_element;
if (vpath == NULL) if (vpath == NULL)
return -1; return (-1);
path_element = vfs_path_get_by_index (vpath, -1); path_element = vfs_path_get_by_index (vpath, -1);
if (vfs_path_element_valid (path_element)) if (vfs_path_element_valid (path_element))
{ {
result = path_element->class->stat ? (*path_element->class->stat) (vpath, buf) : -1; result = path_element->class->stat ? path_element->class->stat (vpath, buf) : -1;
if (result == -1) if (result == -1)
errno = path_element->class->name ? vfs_ferrno (path_element->class) : E_NOTSUPP; errno = path_element->class->name ? vfs_ferrno (path_element->class) : E_NOTSUPP;
} }
@ -585,13 +582,12 @@ mc_lstat (const vfs_path_t * vpath, struct stat *buf)
const vfs_path_element_t *path_element; const vfs_path_element_t *path_element;
if (vpath == NULL) if (vpath == NULL)
return -1; return (-1);
path_element = vfs_path_get_by_index (vpath, -1); path_element = vfs_path_get_by_index (vpath, -1);
if (vfs_path_element_valid (path_element)) if (vfs_path_element_valid (path_element))
{ {
result = path_element->class->lstat ? (*path_element->class->lstat) (vpath, buf) : -1; result = path_element->class->lstat ? path_element->class->lstat (vpath, buf) : -1;
if (result == -1) if (result == -1)
errno = path_element->class->name ? vfs_ferrno (path_element->class) : E_NOTSUPP; errno = path_element->class->name ? vfs_ferrno (path_element->class) : E_NOTSUPP;
} }
@ -609,13 +605,13 @@ mc_fstat (int handle, struct stat *buf)
int result; int result;
if (handle == -1) if (handle == -1)
return -1; return (-1);
vfs = vfs_class_find_by_handle (handle, &fsinfo); vfs = vfs_class_find_by_handle (handle, &fsinfo);
if (vfs == NULL) if (vfs == NULL)
return -1; return (-1);
result = vfs->fstat ? (*vfs->fstat) (fsinfo, buf) : -1; result = vfs->fstat ? vfs->fstat (fsinfo, buf) : -1;
if (result == -1) if (result == -1)
errno = vfs->fstat ? vfs_ferrno (vfs) : E_NOTSUPP; errno = vfs->fstat ? vfs_ferrno (vfs) : E_NOTSUPP;
return result; return result;
@ -633,7 +629,6 @@ mc_getlocalcopy (const vfs_path_t * pathname_vpath)
return NULL; return NULL;
path_element = vfs_path_get_by_index (pathname_vpath, -1); path_element = vfs_path_get_by_index (pathname_vpath, -1);
if (vfs_path_element_valid (path_element)) if (vfs_path_element_valid (path_element))
{ {
result = path_element->class->getlocalcopy != NULL ? result = path_element->class->getlocalcopy != NULL ?
@ -651,20 +646,19 @@ int
mc_ungetlocalcopy (const vfs_path_t * pathname_vpath, const vfs_path_t * local_vpath, mc_ungetlocalcopy (const vfs_path_t * pathname_vpath, const vfs_path_t * local_vpath,
gboolean has_changed) gboolean has_changed)
{ {
int return_value = -1; int result = -1;
const vfs_path_element_t *path_element; const vfs_path_element_t *path_element;
if (pathname_vpath == NULL) if (pathname_vpath == NULL)
return -1; return (-1);
path_element = vfs_path_get_by_index (pathname_vpath, -1); path_element = vfs_path_get_by_index (pathname_vpath, -1);
if (vfs_path_element_valid (path_element)) if (vfs_path_element_valid (path_element))
return_value = path_element->class->ungetlocalcopy != NULL ? result = path_element->class->ungetlocalcopy != NULL ?
path_element->class->ungetlocalcopy (pathname_vpath, local_vpath, has_changed) : path_element->class->ungetlocalcopy (pathname_vpath, local_vpath, has_changed) :
mc_def_ungetlocalcopy (pathname_vpath, local_vpath, has_changed); mc_def_ungetlocalcopy (pathname_vpath, local_vpath, has_changed);
return return_value; return result;
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -686,7 +680,7 @@ mc_chdir (const vfs_path_t * vpath)
vfs_path_t *cd_vpath; vfs_path_t *cd_vpath;
if (vpath == NULL) if (vpath == NULL)
return -1; return (-1);
if (vpath->relative) if (vpath->relative)
cd_vpath = vfs_path_to_absolute (vpath); cd_vpath = vfs_path_to_absolute (vpath);
@ -694,14 +688,11 @@ mc_chdir (const vfs_path_t * vpath)
cd_vpath = vfs_path_clone (vpath); cd_vpath = vfs_path_clone (vpath);
path_element = vfs_path_get_by_index (cd_vpath, -1); path_element = vfs_path_get_by_index (cd_vpath, -1);
if (!vfs_path_element_valid (path_element) || path_element->class->chdir == NULL) if (!vfs_path_element_valid (path_element) || path_element->class->chdir == NULL)
{
goto error_end; goto error_end;
}
result = (*path_element->class->chdir) (cd_vpath);
result = path_element->class->chdir (cd_vpath);
if (result == -1) if (result == -1)
{ {
errno = vfs_ferrno (path_element->class); errno = vfs_ferrno (path_element->class);
@ -750,7 +741,7 @@ mc_chdir (const vfs_path_t * vpath)
error_end: error_end:
vfs_path_free (cd_vpath); vfs_path_free (cd_vpath);
return -1; return (-1);
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -763,13 +754,13 @@ mc_lseek (int fd, off_t offset, int whence)
off_t result; off_t result;
if (fd == -1) if (fd == -1)
return -1; return (-1);
vfs = vfs_class_find_by_handle (fd, &fsinfo); vfs = vfs_class_find_by_handle (fd, &fsinfo);
if (vfs == NULL) if (vfs == NULL)
return -1; return (-1);
result = vfs->lseek ? (*vfs->lseek) (fsinfo, offset, whence) : -1; result = vfs->lseek ? vfs->lseek (fsinfo, offset, whence) : -1;
if (result == -1) if (result == -1)
errno = vfs->lseek ? vfs_ferrno (vfs) : E_NOTSUPP; errno = vfs->lseek ? vfs_ferrno (vfs) : E_NOTSUPP;
return result; return result;
@ -840,7 +831,7 @@ mc_tmpdir (void)
const char *error = NULL; const char *error = NULL;
/* Check if already correctly initialized */ /* Check if already correctly initialized */
if (tmpdir && lstat (tmpdir, &st) == 0 && S_ISDIR (st.st_mode) && if (tmpdir != NULL && lstat (tmpdir, &st) == 0 && S_ISDIR (st.st_mode) &&
st.st_uid == getuid () && (st.st_mode & 0777) == 0700) st.st_uid == getuid () && (st.st_mode & 0777) == 0700)
return tmpdir; return tmpdir;
@ -849,8 +840,7 @@ mc_tmpdir (void)
sys_tmp = TMPDIR_DEFAULT; sys_tmp = TMPDIR_DEFAULT;
pwd = getpwuid (getuid ()); pwd = getpwuid (getuid ());
if (pwd != NULL)
if (pwd)
g_snprintf (buffer, sizeof (buffer), "%s/mc-%s", sys_tmp, pwd->pw_name); g_snprintf (buffer, sizeof (buffer), "%s/mc-%s", sys_tmp, pwd->pw_name);
else else
g_snprintf (buffer, sizeof (buffer), "%s/mc-%lu", sys_tmp, (unsigned long) getuid ()); g_snprintf (buffer, sizeof (buffer), "%s/mc-%lu", sys_tmp, (unsigned long) getuid ());
@ -886,7 +876,7 @@ mc_tmpdir (void)
gboolean fallback_ok = FALSE; gboolean fallback_ok = FALSE;
vfs_path_t *test_vpath; vfs_path_t *test_vpath;
if (*error) if (*error != '\0')
fprintf (stderr, error, buffer); fprintf (stderr, error, buffer);
/* Test if sys_tmp is suitable for temporary files */ /* Test if sys_tmp is suitable for temporary files */
@ -924,7 +914,7 @@ mc_tmpdir (void)
tmpdir = buffer; tmpdir = buffer;
if (!error) if (error == NULL)
g_setenv ("MC_TMPDIR", tmpdir, TRUE); g_setenv ("MC_TMPDIR", tmpdir, TRUE);
return tmpdir; return tmpdir;

View File

@ -87,7 +87,7 @@ struct vfs_s_inode
struct vfs_s_entry *ent; /* Our entry in the parent directory - struct vfs_s_entry *ent; /* Our entry in the parent directory -
use only for directories because they use only for directories because they
cannot be hardlinked */ cannot be hardlinked */
GList *subdir; /* If this is a directory, its entry. List of vfs_s_entry */ GQueue *subdir; /* If this is a directory, its entry. List of vfs_s_entry */
struct stat st; /* Parameters of this inode */ struct stat st; /* Parameters of this inode */
char *linkname; /* Symlink's contents */ char *linkname; /* Symlink's contents */
char *localname; /* Filename of local file, if we have one */ char *localname; /* Filename of local file, if we have one */

View File

@ -241,7 +241,7 @@ history_show (history_descriptor_t * hd)
if (WIDGET (query_dlg)->y < hd->y) if (WIDGET (query_dlg)->y < hd->y)
{ {
/* history is below base widget -- place recent item on top */ /* history is above base widget -- revert order to place recent item at bottom */
/* revert history direction */ /* revert history direction */
g_queue_reverse (hd->listbox->list); g_queue_reverse (hd->listbox->list);
if (hd->current < 0 || (size_t) hd->current >= count) if (hd->current < 0 || (size_t) hd->current >= count)
@ -251,7 +251,7 @@ history_show (history_descriptor_t * hd)
} }
else else
{ {
/* history is above base widget -- place recent item at bottom */ /* history is below base widget -- keep order to place recent item on top */
if (hd->current > 0) if (hd->current > 0)
listbox_select_entry (hd->listbox, hd->current); listbox_select_entry (hd->listbox, hd->current);
} }
@ -284,7 +284,7 @@ history_show (history_descriptor_t * hd)
z = g_list_prepend (z, hd->release (hd, LENTRY (hi->data))); z = g_list_prepend (z, hd->release (hd, LENTRY (hi->data)));
/* restore history direction */ /* restore history direction */
if (WIDGET (query_dlg)->y >= hd->y) if (WIDGET (query_dlg)->y < hd->y)
z = g_list_reverse (z); z = g_list_reverse (z);
dlg_destroy (query_dlg); dlg_destroy (query_dlg);

View File

@ -5,7 +5,7 @@ dnl
AC_DEFUN([mc_ASSERT], AC_DEFUN([mc_ASSERT],
[ [
AC_ARG_ENABLE([assert], AC_ARG_ENABLE([assert],
AS_HELP_STRING([--enable-assert], [turn on assertions [yes]]), AS_HELP_STRING([--enable-assert], [turn on assertions @<:@yes@:>@]),
[ [
if test "x$enableval" = xno; then if test "x$enableval" = xno; then
enable_assert=no enable_assert=no

View File

@ -5,7 +5,7 @@ dnl
AC_DEFUN([mc_BACKGROUND], AC_DEFUN([mc_BACKGROUND],
[ [
AC_ARG_ENABLE([background], AC_ARG_ENABLE([background],
AS_HELP_STRING([--enable-background], [Support for background file operations [yes]]), AS_HELP_STRING([--enable-background], [Support for background file operations @<:@yes@:>@]),
[ [
if test "x$enableval" = xno; then if test "x$enableval" = xno; then
enable_background=no enable_background=no

View File

@ -1188,7 +1188,7 @@ edit_files (const GList * files)
static gboolean made_directory = FALSE; static gboolean made_directory = FALSE;
WDialog *edit_dlg; WDialog *edit_dlg;
WMenuBar *menubar; WMenuBar *menubar;
Widget *w; Widget *w, *wd;
const GList *file; const GList *file;
gboolean ok = FALSE; gboolean ok = FALSE;
@ -1213,7 +1213,8 @@ edit_files (const GList * files)
edit_dlg = edit_dlg =
dlg_create (FALSE, 0, 0, 1, 1, WPOS_FULLSCREEN, FALSE, NULL, edit_dialog_callback, dlg_create (FALSE, 0, 0, 1, 1, WPOS_FULLSCREEN, FALSE, NULL, edit_dialog_callback,
edit_dialog_mouse_callback, "[Internal File Editor]", NULL); edit_dialog_mouse_callback, "[Internal File Editor]", NULL);
widget_want_tab (WIDGET (edit_dlg), TRUE); wd = WIDGET (edit_dlg);
widget_want_tab (wd, TRUE);
edit_dlg->get_shortcut = edit_get_shortcut; edit_dlg->get_shortcut = edit_get_shortcut;
edit_dlg->get_title = edit_get_title; edit_dlg->get_title = edit_get_title;
@ -1228,11 +1229,10 @@ edit_files (const GList * files)
for (file = files; file != NULL; file = g_list_next (file)) for (file = files; file != NULL; file = g_list_next (file))
{ {
Widget *w = WIDGET (edit_dlg);
mcedit_arg_t *f = (mcedit_arg_t *) file->data; mcedit_arg_t *f = (mcedit_arg_t *) file->data;
gboolean f_ok; gboolean f_ok;
f_ok = edit_add_window (edit_dlg, w->y + 1, w->x, w->lines - 2, w->cols, f->file_vpath, f_ok = edit_add_window (edit_dlg, wd->y + 1, wd->x, wd->lines - 2, wd->cols, f->file_vpath,
f->line_number); f->line_number);
/* at least one file has been opened succefully */ /* at least one file has been opened succefully */
ok = ok || f_ok; ok = ok || f_ok;
@ -1241,7 +1241,7 @@ edit_files (const GList * files)
if (ok) if (ok)
dlg_run (edit_dlg); dlg_run (edit_dlg);
if (!ok || widget_get_state (WIDGET (edit_dlg), WST_CLOSED)) if (!ok || widget_get_state (wd, WST_CLOSED))
dlg_destroy (edit_dlg); dlg_destroy (edit_dlg);
return ok; return ok;

View File

@ -632,7 +632,7 @@ panel_options_box (void)
gboolean simple_swap; gboolean simple_swap;
simple_swap = mc_config_get_bool (mc_global.main_config, CONFIG_PANELS_SECTION, simple_swap = mc_config_get_bool (mc_global.main_config, CONFIG_PANELS_SECTION,
"simple_swap", FALSE) ? 1 : 0; "simple_swap", FALSE);
{ {
const char *qsearch_options[] = { const char *qsearch_options[] = {
N_("Case &insensitive"), N_("Case &insensitive"),
@ -943,9 +943,9 @@ display_bits_box (void)
mc_global.eight_bit_clean = current_mode < 3; mc_global.eight_bit_clean = current_mode < 3;
mc_global.full_eight_bits = current_mode < 2; mc_global.full_eight_bits = current_mode < 2;
#ifndef HAVE_SLANG #ifndef HAVE_SLANG
meta (stdscr, mc_global.eight_bit_clean); tty_display_8bit (mc_global.eight_bit_clean);
#else #else
SLsmg_Display_Eight_Bit = mc_global.full_eight_bits ? 128 : 160; tty_display_8bit (mc_global.full_eight_bits);
#endif #endif
use_8th_bit_as_meta = !new_meta; use_8th_bit_as_meta = !new_meta;
} }

View File

@ -779,16 +779,14 @@ setup_panels (void)
/* ...then rows and origin */ /* ...then rows and origin */
if (panels_layout.horizontal_split) if (panels_layout.horizontal_split)
{ {
widget_set_size (panels[0].widget, start_y, panels[0].widget->x, widget_set_size (panels[0].widget, start_y, mw->x, panels_layout.top_panel_size,
panels_layout.top_panel_size, panels[0].widget->cols); panels[0].widget->cols);
widget_set_size (panels[1].widget, start_y + panels_layout.top_panel_size, widget_set_size (panels[1].widget, start_y + panels_layout.top_panel_size, mw->x,
panels[1].widget->x, height - panels_layout.top_panel_size, height - panels_layout.top_panel_size, panels[1].widget->cols);
panels[1].widget->cols);
} }
else else
{ {
widget_set_size (panels[0].widget, start_y, panels[0].widget->x, height, widget_set_size (panels[0].widget, start_y, mw->x, height, panels[0].widget->cols);
panels[0].widget->cols);
widget_set_size (panels[1].widget, start_y, panels[1].widget->x, height, widget_set_size (panels[1].widget, start_y, panels[1].widget->x, height,
panels[1].widget->cols); panels[1].widget->cols);
} }

View File

@ -63,6 +63,12 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#else
#include <sys/time.h>
#include <unistd.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H

View File

@ -71,7 +71,6 @@ subshell_handle_cons_saver (void)
pid_t pid; pid_t pid;
pid = waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG); pid = waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
if (pid == cons_saver_pid) if (pid == cons_saver_pid)
{ {

View File

@ -271,7 +271,7 @@ extfs_find_entry_int (struct vfs_s_inode *dir, const char *name, GSList * list,
} }
pdir = pent; pdir = pent;
pl = g_list_find_custom (pent->ino->subdir, p, vfs_s_entry_compare); pl = g_queue_find_custom (pent->ino->subdir, p, vfs_s_entry_compare);
pent = pl != NULL ? VFS_ENTRY (pl->data) : NULL; pent = pl != NULL ? VFS_ENTRY (pl->data) : NULL;
if (pent != NULL && q + 1 > name_end) if (pent != NULL && q + 1 > name_end)
{ {
@ -512,13 +512,13 @@ extfs_read_archive (FILE * extfsd, struct extfs_super_t *current_archive)
{ {
entry = extfs_entry_new (super->me, p, pent->ino); entry = extfs_entry_new (super->me, p, pent->ino);
entry->dir = pent->ino; entry->dir = pent->ino;
pent->ino->subdir = g_list_append (pent->ino->subdir, entry); g_queue_push_tail (pent->ino->subdir, entry);
} }
else else
{ {
entry = extfs_entry_new (super->me, p, super->root); entry = extfs_entry_new (super->me, p, super->root);
entry->dir = super->root; entry->dir = super->root;
super->root->subdir = g_list_append (super->root->subdir, entry); g_queue_push_tail (super->root->subdir, entry);
} }
if (!S_ISLNK (hstat.st_mode) && (current_link_name != NULL)) if (!S_ISLNK (hstat.st_mode) && (current_link_name != NULL))
@ -1014,7 +1014,7 @@ extfs_opendir (const vfs_path_t * vpath)
ERRNOR (ENOTDIR, NULL); ERRNOR (ENOTDIR, NULL);
info = g_new (GList *, 1); info = g_new (GList *, 1);
*info = entry->ino->subdir; *info = g_queue_peek_head_link (entry->ino->subdir);
return info; return info;
} }

View File

@ -47,7 +47,7 @@ flag==1 {
else else
if (index($6, ".") != 0) if (index($6, ".") != 0)
$6="-rw-r--r--" $6="-rw-r--r--"
printf "%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n", $6, uid, gid, $1, a[2], a[1], a[3], $5, str printf "%s 1 %s %s %d %02d/%02d/%02d %s %s\n", $6, uid, gid, $1, a[2], a[1], a[3], $5, str
}' }'
} }
@ -105,7 +105,7 @@ mcrar5fs_list ()
} }
### and finally ### and finally
printf ("%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n", printf ("%s 1 %s %s %d %02d/%02d/%02d %s %s\n",
attrs, uid, gid, size, date[2], date[3], date[1], time, name); attrs, uid, gid, size, date[2], date[3], date[1], time, name);
} }
' '

View File

@ -1765,12 +1765,25 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
} }
if (sock == -1) if (sock == -1)
goto fallback; {
fallback:
if (ftp_super->strict == RFC_AUTODETECT)
{
/* It's our first attempt to get a directory listing from this
server (UNIX style LIST command) */
ftp_super->strict = RFC_STRICT;
/* I hate goto, but recursive call needs another 8K on stack */
/* return ftpfs_dir_load (me, dir, remote_path); */
cd_first = TRUE;
goto again;
}
/* Clear the interrupt flag */ vfs_print_message ("%s", _("ftpfs: failed; nowhere to fallback to"));
tty_enable_interrupt_key (); ERRNOR (EACCES, -1);
}
vfs_parse_ls_lga_init (); vfs_parse_ls_lga_init ();
while (TRUE) while (TRUE)
{ {
int i; int i;
@ -1787,7 +1800,6 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
me->verrno = ECONNRESET; me->verrno = ECONNRESET;
close (sock); close (sock);
ftp_super->ctl_connection_busy = FALSE; ftp_super->ctl_connection_busy = FALSE;
tty_disable_interrupt_key ();
ftpfs_get_reply (me, ftp_super->sock, NULL, 0); ftpfs_get_reply (me, ftp_super->sock, NULL, 0);
vfs_print_message (_("%s: failure"), me->name); vfs_print_message (_("%s: failure"), me->name);
return (-1); return (-1);
@ -1844,21 +1856,6 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
vfs_print_message (_("%s: done."), me->name); vfs_print_message (_("%s: done."), me->name);
return 0; return 0;
fallback:
if (ftp_super->strict == RFC_AUTODETECT)
{
/* It's our first attempt to get a directory listing from this
server (UNIX style LIST command) */
ftp_super->strict = RFC_STRICT;
/* I hate goto, but recursive call needs another 8K on stack */
/* return ftpfs_dir_load (me, dir, remote_path); */
cd_first = TRUE;
goto again;
}
vfs_print_message ("%s", _("ftpfs: failed; nowhere to fallback to"));
ERRNOR (EACCES, -1);
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */

View File

@ -27,6 +27,14 @@
#include <config.h> #include <config.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#else
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#include "lib/global.h" #include "lib/global.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -301,8 +301,10 @@ void mcview_toggle_nroff_mode (WView * view);
void mcview_toggle_hex_mode (WView * view); void mcview_toggle_hex_mode (WView * view);
void mcview_init (WView * view); void mcview_init (WView * view);
void mcview_done (WView * view); void mcview_done (WView * view);
#ifdef HAVE_CHARSET
void mcview_select_encoding (WView * view); void mcview_select_encoding (WView * view);
void mcview_set_codeset (WView * view); void mcview_set_codeset (WView * view);
#endif
void mcview_show_error (WView * view, const char *error); void mcview_show_error (WView * view, const char *error);
off_t mcview_bol (WView * view, off_t current, off_t limit); off_t mcview_bol (WView * view, off_t current, off_t limit);
off_t mcview_eol (WView * view, off_t current); off_t mcview_eol (WView * view, off_t current);

View File

@ -257,10 +257,10 @@ mcview_done (WView * view)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#ifdef HAVE_CHARSET
void void
mcview_set_codeset (WView * view) mcview_set_codeset (WView * view)
{ {
#ifdef HAVE_CHARSET
const char *cp_id = NULL; const char *cp_id = NULL;
view->utf8 = TRUE; view->utf8 = TRUE;
@ -280,21 +280,17 @@ mcview_set_codeset (WView * view)
view->utf8 = (gboolean) str_isutf8 (cp_id); view->utf8 = (gboolean) str_isutf8 (cp_id);
view->dpy_wrap_dirty = TRUE; view->dpy_wrap_dirty = TRUE;
} }
#else
(void) view;
#endif
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#ifdef HAVE_CHARSET
void void
mcview_select_encoding (WView * view) mcview_select_encoding (WView * view)
{ {
if (do_select_codepage ()) if (do_select_codepage ())
mcview_set_codeset (view); mcview_set_codeset (view);
} }
#endif #endif /* HAVE_CHARSET */
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */

View File

@ -309,7 +309,9 @@ mcview_load (WView * view, const char *command, const char *file, int start_line
if (!mcview_is_in_panel (view)) if (!mcview_is_in_panel (view))
view->dpy_text_column = 0; view->dpy_text_column = 0;
#ifdef HAVE_CHARSET
mcview_set_codeset (view); mcview_set_codeset (view);
#endif
if (command != NULL && (view->mode_flags.magic || file == NULL || file[0] == '\0')) if (command != NULL && (view->mode_flags.magic || file == NULL || file[0] == '\0'))
retval = mcview_load_command_output (view, command); retval = mcview_load_command_output (view, command);

View File

@ -1,9 +1,9 @@
drwx------ 1 <<uid>> <<gid>> 0 2016-06-07 20:43:00 ./.dosbox drwx------ 1 <<uid>> <<gid>> 0 2016-06-07 20:43:00 .dosbox
-rw-rw-r-- 1 <<uid>> <<gid>> 10730 2016-06-07 20:43:00 ./.dosbox/dosbox-0.74.conf -rw-rw-r-- 1 <<uid>> <<gid>> 10730 2016-06-07 20:43:00 .dosbox/dosbox-0.74.conf
-rw------- 1 <<uid>> <<gid>> 11032 2016-11-23 07:10:00 ./.viminfo -rw------- 1 <<uid>> <<gid>> 11032 2016-11-23 07:10:00 .viminfo
-rw-rw-r-- 1 <<uid>> <<gid>> 205 2016-10-26 13:14:00 ./.wget-hsts -rw-rw-r-- 1 <<uid>> <<gid>> 205 2016-10-26 13:14:00 .wget-hsts
-rw-rw-r-- 1 <<uid>> <<gid>> 7527 2016-04-17 01:21:00 ./.xboardrc -rw-rw-r-- 1 <<uid>> <<gid>> 7527 2016-04-17 01:21:00 .xboardrc
-rw-rw-r-- 1 <<uid>> <<gid>> 559 2016-09-29 01:08:00 ./.xchm -rw-rw-r-- 1 <<uid>> <<gid>> 559 2016-09-29 01:08:00 .xchm
-rw-rw-r-- 1 <<uid>> <<gid>> 130 2015-12-27 17:08:00 ./.xinputrc -rw-rw-r-- 1 <<uid>> <<gid>> 130 2015-12-27 17:08:00 .xinputrc
-rw-r--r-- 1 <<uid>> <<gid>> 6 2016-11-23 07:39:00 ./filename with spaces.txt -rw-r--r-- 1 <<uid>> <<gid>> 6 2016-11-23 07:39:00 filename with spaces.txt
-rw-rw-r-- 1 <<uid>> <<gid>> 5869937 2016-11-23 07:43:00 ./log.txt -rw-rw-r-- 1 <<uid>> <<gid>> 5869937 2016-11-23 07:43:00 log.txt

View File

@ -1,9 +1,9 @@
drwx------ 1 <<uid>> <<gid>> 0 2016-06-07 20:43:00 ./.dosbox drwx------ 1 <<uid>> <<gid>> 0 2016-06-07 20:43:00 .dosbox
-rw-rw-r-- 1 <<uid>> <<gid>> 10730 2016-06-07 20:43:00 ./.dosbox/dosbox-0.74.conf -rw-rw-r-- 1 <<uid>> <<gid>> 10730 2016-06-07 20:43:00 .dosbox/dosbox-0.74.conf
-rw------- 1 <<uid>> <<gid>> 11032 2016-11-23 07:10:00 ./.viminfo -rw------- 1 <<uid>> <<gid>> 11032 2016-11-23 07:10:00 .viminfo
-rw-rw-r-- 1 <<uid>> <<gid>> 205 2016-10-26 13:14:00 ./.wget-hsts -rw-rw-r-- 1 <<uid>> <<gid>> 205 2016-10-26 13:14:00 .wget-hsts
-rw-rw-r-- 1 <<uid>> <<gid>> 7527 2016-04-17 01:21:00 ./.xboardrc -rw-rw-r-- 1 <<uid>> <<gid>> 7527 2016-04-17 01:21:00 .xboardrc
-rw-rw-r-- 1 <<uid>> <<gid>> 559 2016-09-29 01:08:00 ./.xchm -rw-rw-r-- 1 <<uid>> <<gid>> 559 2016-09-29 01:08:00 .xchm
-rw-rw-r-- 1 <<uid>> <<gid>> 130 2015-12-27 17:08:00 ./.xinputrc -rw-rw-r-- 1 <<uid>> <<gid>> 130 2015-12-27 17:08:00 .xinputrc
-rw-r--r-- 1 <<uid>> <<gid>> 6 2016-11-23 07:39:00 ./filename with spaces.txt -rw-r--r-- 1 <<uid>> <<gid>> 6 2016-11-23 07:39:00 filename with spaces.txt
-rw-rw-r-- 1 <<uid>> <<gid>> 5869937 2016-11-23 07:43:00 ./log.txt -rw-rw-r-- 1 <<uid>> <<gid>> 5869937 2016-11-23 07:43:00 log.txt