Commit Graph

79 Commits

Author SHA1 Message Date
Andrew Borodin 68d9961977 Ticket #4022: fix compile failure on AIX 7.2.
Rename MC VFS flags to avoid name conflicts with system-wide VFS flags
on some OSes (such as AIX).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-11-18 21:27:56 +03:00
Andrew Borodin 0fbd98fece Join vfs_class_flags_t and vfs_subclass_flags_t.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin c764d60238 VFS: (vfs_s_subclass): derive from vfs_class.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin 1876ef7b84 lib/utilunix.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:47:59 +03:00
Andrew Borodin 1dd8a47987 Ticket #3955: code cleanup before 4.8.23 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:44:40 +03:00
Andrew Borodin 1fec6e9854 Partially revert "VFS: (vfs_s_subclass): make the derived class from vfs_class."
This reverts commit 5d1284c4a6.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-09-10 12:47:12 +03:00
Andrew Borodin 5d1284c4a6 VFS: (vfs_s_subclass): make the derived class from vfs_class.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-09-09 19:10:43 +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
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
Yury V. Zaytsev 151b08b412 Ticket #3693: clarify that lack of `noreturn` attribute is on purpose
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-03-04 18:52:12 +01:00
Yury V. Zaytsev f09d863ddf Revert "(my_exit): cleanup no attribute noreturn warning."
This reverts commit b91ab44b43.
2017-03-04 18:27:02 +01:00
Andrew Borodin e9fd11bfcd Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 19:12:55 +03:00
Andreas Mohr 9c43890f0d (my_systemv): cleanup unreachable-code warning.
Compiler with my_exit() 'noreturn' knowledge will complain about
never reachable break statement.

Reported by clang compiler.

(Maybe there is a better code sequence)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-11-21 13:12:55 +03:00
Andreas Mohr b91ab44b43 (my_exit): cleanup no attribute noreturn warning.
utilunix.c:360:1: error: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-11-21 13:12:55 +03:00
Andrew Borodin 0c73ca195f Ticket #3660: unable to view archive content using F3.
(mc_popen): fix termination of command array.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-07-09 19:21:15 +03:00
Andrew Borodin 44859027b4 Ticket #3646: Filtered View doesn't work.
The bug:
1. Go to the source directory for version 4.8.17.
2. Enter the command "ls -l misc/mc*". The output will show at least 7 files.
3. Start mc.
4. Press Meta-! to open the "Filtered View" dialogue box.
5. Enter the same command: "ls -l misc/mc*".
Result:
MC displays the following error:
"ls: cannot access misc/mc*: No such file or directory".

Fix:
(mc_popen): use popen(3) way: pass command to /bin/sh using the -c flag.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-28 08:16:31 +03:00
Andreas Mohr 1c2060c28f (mc_realpath): cleanup cppcheck warning.
Cleanup following cppcheck warnings:

[lib/utilunix.c:1109]: (style) Unused variable: link_path.
[lib/utilunix.c:1113]: (style) Variable 'readlinks' is assigned a value that is never used.
[lib/utilunix.c:1114]: (style) Unused variable: n.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin bc14ff44c8 Remove min() and max() macros. Use MIN() and MAX() macros from GLib.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Yury V. Zaytsev a8f512c12c Remove unneeded `struct` keyword for typedef'd structs
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 09:23:38 +03:00
Andrew Borodin 471ea781ca Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:10 +03:00
Andreas Mohr 697e406eb8 Robust sizeof() usage at function parameter and use memcpy destination sizeof...
...for more resilient to errors.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:09 +03:00
Andrew Borodin 4f45767601 (get_owner): change type of parameter and return value:
return value: from "char *" to "const char *";
parameter: from int to uid_t.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:32:52 +03:00
Andrew Borodin a95320cb15 (get_group): change type of parameter and return value:
return value: from "char *" to "const char *";
parameter: from int to gid_t.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:32:52 +03:00
Andrew Borodin a382b1558b Ticket #3420: code cleanup before 4.8.15 release.
Ticket #3457: (my_systemv_flags): fix memory leak.
(my_system_make_arg_array): ret rid of string duplications."

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 17:59:18 +03:00
Andreas Mohr 4821259d85 Ticket #3437: (custom_canonicalize_pathname): fix heap-buffer-overflow.
Only use strncmp when path has enough room (greater then url_delim_len
size).
Overflow happen when path = './'.

(Found by AddressSanitizer.)

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:49 +03:00
Andrew Borodin b698b7e834 Ticket #3435: clang compiler fixes/cleanups.
Since O_* macros are used in lib/global.h, include <fcntl.h> there.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:49 +03:00
Ben Woods 544a6b625e Ticket #3444: (mc_popen): use the PATH environment variable
...to search for the executable when opening pipe:
add the G_SPAWN_SEARCH_PATH flag to the g_spawn_async_with_pipes() call,
which cause mc to use the PATH environment variable to search for the
executable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-04-19 15:29:39 +03:00
Andrew Borodin 42e7e39bd8 Add IS_PATH_SEP macro and use it.
Also massive use of PATH_SEP and PATH_SEP_STR macros.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:13:02 +03:00
Andrew Borodin 454479549c Update copyright years. 2015-02-26 09:12:08 +03:00
Andrew Borodin a31b78003e Ticket #2966: fix view of broken manpages.
Initial commit: create MC pipe class to capture stdout and stderr of
spawn processes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-27 20:24:12 +04:00
Andrew Borodin e5203cb023 Fix name of FSF in all *.c files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:17 +04:00
Andrew Borodin f0da49345a Collapse list of copyright years to ranges. Add 2014 year.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin 094fd0cd89 Use symbolic names for standard file descriptors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:26:17 +04:00
Andrew Borodin bb65b46790 Fix use of uninitialized memory in sigaction structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Slava Zanko 0d489acd58 cppcheck: reduce variable scope.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Andrew Borodin 61dc030772 More tests for canonicalize_pathname().
(custom_canonicalize_pathname): fix wrong condition. Remove redundant
break.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin e7dc599e42 Use "'" instead of "`" for messages and comments quoting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:03 +03:00
Slava Zanko 2406284762 Add function lib/utilunix.c:my_systemv_flags()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:39:33 +03:00
Slava Zanko c2f030f2e8 Add new functions:
* int my_systeml (int flags, const char *shell, ...);
 * int my_systemv (const char *command, char *const argv[]);

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:39:33 +03:00
Slava Zanko 1535d12d43 Code refactoring: my_system was split by few functions.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:39:33 +03:00
Slava Zanko d32fefee76 Ticket #2206: Add jump support to target line in some external editors
Added own wrapper for _exit() system call. Useful for testing.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:39:32 +03:00
Andrew Borodin 2940b7455d Fix of DOXYGEN docs: @return instead of @returns
...and other minor corrections.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-09 10:05:13 +04:00
Ilia Maslakov 55c8f041da fixed doxygen documentation
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2012-09-10 14:29:53 +03:00
Andrew Borodin e7fb3526f3 Core, mceditor, mcviewer and mcdiffviewer code tweak and cleanup
...in case of build with --disable-charset option.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-06-25 16:58:57 +04:00
Andrew Borodin 308237aa11 Fixed preprocessor conditions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:06:00 +03:00
Andrew Borodin aadf01f390 Include sys/param.h conditionally.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:04:57 +03:00
Andrew Borodin 19a4eb1ca6 Added D_CENTER flag to query dialog flags
...to forced place a query dialog in the center of the screen.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-08 10:37:56 +03:00
Slava Zanko 53c500f58c Moved functions mc_mkstemp() and mc_tempdir() to VFS module.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:25 +03:00
Slava Zanko c47bc3778e added vfs_path_build_filename() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:33:12 +03:00