Commit Graph

14124 Commits

Author SHA1 Message Date
Andrew Borodin
af466458b7 vfs: create enum vfs_linear_state_t instead of defines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
95e1ab3064 vfs: use LS_NOT_LINEAR constant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
cb354e5490 (vfs_file_handler_t::changed): change type from int to gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
a514ce6d13 (vfs_s_super::want_stale): change type from int to gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
f1d9b67bb5 lib/vfs/direntry.c: apply cpding style; cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
c524d6d49c src/cons.handler.c: fix include.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
e151b0756f src/usermenu.c: cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
80a4982d95 Refactor file manager creation.
* (create_panels_and_run_mc): rename to create_file_manager.
  Move call of dlg_run() to do_nc().
  * (create_panels): create file panels only. Move creation of
  other widgets to create_file_manager().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andreas Mohr
00416d5cf3 (my_type_of): remove unreachable code.
Found by Clang 4.0.1.

edit.c:896:16: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
        return 0x80000000UL;
               ^~~~~~~~~~~~

(whole my_type_of() is suspect)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andreas Mohr
ac9e4c321a (panel_recursive_cd_to_parent): fix potential null pointer dereference.
Found by GCC 6.4.0.

panel.c: In function 'panel_reload':
panel.c:4188:40: warning: potential null pointer dereference [-Wnull-dereference]
         if (IS_PATH_SEP (panel_cwd_path[0]) && panel_cwd_path[1] == '\0')

../../lib/global.h:132:26: note: in definition of macro 'IS_PATH_SEP'
 #define IS_PATH_SEP(c) ((c) == PATH_SEP)
                          ^

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andreas Mohr
6aa2cb1cad (my_systemv): cleanup implicit-fallthrough warning.
Found by GCC 7.2.0

utilunix.c: In function 'my_systemv':
utilunix.c:455:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
             my_exit (127);      /* Exec error */
             ^~~~~~~~~~~~~
utilunix.c:458:5: note: here
     default:
     ^~~~~~~

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andreas Mohr
ae3cf817f4 Cleanup implicit-fallthrough warnings.
Found by GCC 7.2.0

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
2043ef74a9 (execute_menu_command): fix mcview_viewer() call.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
7abd640b41 Sync with gnulib 467061a2014d742a27eb8d4498e8d09fb3225d53.
Remove SVR2 support

SVR2 was obsolete by 1986 and is no longer supported by anybody, and its
code was getting in the way of use of this module by Emacs, which has
its own 'read' function anyway.

  * src/filemanager/mountlist.c: remove SVR2-specific code.
  * m4.include/fsusage.m4: do not test for sys/filsys.h or set
  STAT_READ_FILSYS.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
ddd645526a Update copyright years. 2018-02-04 11:30:22 +03:00
Andrew Borodin
a38accd389 (mc_realpath): ignore path encoding.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
074008025b mcviewer: refactor mode flags.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
6e994011f5 (vfs_path_url_split): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
73979369d1 Support __attribute__((fallthrough)) if possible.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
3ae7ad4449 tests: fix DSO link error in case of --enable-mclib.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
b7c54f64bb (vfs_mkstemps): don't allocate a large memory chunk.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
97fe1a706d Ticket #3876: code clean up before 4.8.21 release.
Initial commit: remove invalid information from manual pages (en & ru).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
e4d9a817a7 Merge branch '3149_move_compute_total'
* 3149_move_compute_total: (21 commits)
  Update po/*.po files.
  Don't calculate totals for copy and erase operations on single file.
  (file_is_symlink_to_dir): new API.
  (panel_operate): add TODO for rename/move of several directories.
  Don't calculate totals for move operation on single file.
  (operate_single_file): don't calculate directory size before rename or move...
  (operate_single_file): make src and dest file name unescaping
  Refactor preparation of file/dir operation.
  (transform_source): fix memory leak in error case.
  (operate_one_file): refactoring, add extra variables.
  (operate_single_file): refactoring, add extra variables.
  (move_dir_dir): refactoring: move erase of copied directories to separate function.
  Refactoring: move file remove to separate function.
  Refactroing: move same file/dir check to separate function.
  Refactoring: move of directory erase to separate function.
  (panel_operate): refactoring: move file/dir operation to separate function.
  (panel_operate): refactoring: move single file/dir operation to separate function.
  (panel_operate): refactoring: move copy/move confirmation prompt to separate function.
  (panel_operate): refactoring: move delete confirmation prompt to separate function.
  (panel_operate): refactoring: move check of single entry to separate function.
  ...
2018-02-03 18:39:39 +03:00
Andrew Borodin
d99bdf63e4 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-03 18:38:10 +03:00
Andrew Borodin
c139b82711 Don't calculate totals for copy and erase operations on single file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-03 18:26:42 +03:00
Andrew Borodin
b6a65e084d (file_is_symlink_to_dir): new API.
Returns TRUE if file is symbolic link to directory, FALSE otherwise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-03 18:26:42 +03:00
Andrew Borodin
64526def8a (panel_operate): add TODO for rename/move of several directories.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-03 18:26:42 +03:00
Andrew Borodin
3ba4417c18 Don't calculate totals for move operation on single file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-03 18:26:41 +03:00
Andrew Borodin
7dac8f7bd6 (operate_single_file): don't calculate directory size before rename or move...
...of single directory within same file system.

First try rename the single file/dir. If case of unsuccess, use
copy+delete with directory size calclulation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
ef5d346dd9 (operate_single_file): make src and dest file name unescaping
...as it made in operate_one_file.

(build_dest): make dest file name unescaping here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
1071c232c7 Refactor preparation of file/dir operation.
(transform_source): rename to build_dest and really build destination
file name here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
1337ed1c55 (transform_source): fix memory leak in error case.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
763e996076 (operate_one_file): refactoring, add extra variables.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
816b503e3a (operate_single_file): refactoring, add extra variables.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
07bbfb73e3 (move_dir_dir): refactoring: move erase of copied directories to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
93c6687cb7 Refactoring: move file remove to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
9d55d861e2 Refactroing: move same file/dir check to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
6ea94459d3 Refactoring: move of directory erase to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
9ff91634f5 (panel_operate): refactoring: move file/dir operation to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
cd7db69e69 (panel_operate): refactoring: move single file/dir operation to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
5d98418133 (panel_operate): refactoring: move copy/move confirmation prompt to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
4aad3c524a (panel_operate): refactoring: move delete confirmation prompt to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
ead9063880 (panel_operate): refactoring: move check of single entry to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
edd67ef445 Ticket #3149: don't calculate directory size before rename or move...
...whitin same file system.

Initial commit: cleanup: WITH_FULL_PATHS is defined permanently.
Remove it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-21 20:52:10 +03:00
Andrew Borodin
17828095f1 Merge branch '3857_mekedev'
* 3857_mekedev:
  Ticket #3857: avoid glibc 2.25 warnings about major(), minor(), and makedev().
2018-01-20 10:58:32 +03:00
Andrew Borodin
fcf5ba5be2 Ticket #3857: avoid glibc 2.25 warnings about major(), minor(), and makedev().
See gnulib a512e041120e9012e69afa2f5c3adc196ec4999a:

glibc 2.25 is deprecating the namespace pollution of <sys/types.h>
injecting major(), minor(), and makedev() into the compilation
environment, with a warning that insists that users include
<sys/sysmacros.h> instead.  However, because the expansion of
AC_HEADER_MAJOR didn't bother checking sys/sysmacros.h until after
probing whether sys/types.h pollutes the namespace, it was not defining
MAJOR_IN_SYSMACROS, with the result that code compiled with -Werror
chokes on the deprecation warnings because it was not including
sysmacros.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-01-20 10:57:42 +03:00
Andrew V. Samoilov
d94a568cbf * doc/NEWS: typo
Signed-off-by: Andrew V. Samoilov <asamoilov@gmail.com>
2018-01-12 00:42:40 +02:00
Andrew Borodin
79b6a772fe Merge branch '3406_sftp_error_31'
* 3406_sftp_error_31:
  (panel_operate_init_totals): fix directory size calculation.
  (panel_operate_init_totals): change the 'source' argument type...
  sftpfs: handle file operation errors.
  (sftpfs_close_file): return actual result of sftp file close operation.
  (sftpfs_waitsocket): refactor and use it for file and directory operations.
  Clarify usage of sftpfs_internal_stat() return value.
  sftpfs: refactoring: move initialization of sftp stat operations to separate function.
  sftpfs: refactoring: move initialization of sftp operation to separate function.
  (sftpfs_waitsocket): handle socket errors.
  sftpfs: refactoring: move handling of socket errors to separate function.
  (sftpfs_fstat): use sftpfs_attr_to_stat().
  sftpfs: refactoring: move obtaining of stat info from sftp attributes to separate function.
  sftpfs: refactoring: move error check to separate function.
  Fix sftp error 31 (proto 4 and 2)
  sftp handle LIBSSH2_FX_PERMISSION_DENIED as EACCES.
  Ticket #3406: sftpfs: fix -31 SFTP Protocol Error when transferring file via SFTP Link.
2017-12-28 10:25:24 +03:00
Andrew Borodin
322d0804c7 (panel_operate_init_totals): fix directory size calculation.
Don't calculate directory size if object is not a directory.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-12-28 10:22:00 +03:00
Andrew Borodin
212207026b (panel_operate_init_totals): change the 'source' argument type...
...to get rid of vfs_path_t -> char * -> vfs_path_t conversion.
2017-12-28 10:22:00 +03:00