Commit Graph

112 Commits

Author SHA1 Message Date
Andrew Borodin 72056890a7 (diff_two_paths): minor optimization: exit loop ASAP.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-11-17 16:01:29 +03:00
Andrew Borodin 02effb2499 (diff_two_paths): reduce variable scopes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-11-17 16:01:29 +03:00
Andrew Borodin e9fd11bfcd Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 19:12:55 +03:00
Andrew Borodin 28ca14d73a Aggressive use of whitespace() and whiteness() macros.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin 496abc0e1f Rename mc_config_get_profile_root() to mc_get_profile_root()
...and move it out from lib/mcconfig.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-04 09:37:50 +03:00
Andrew Borodin 83504f2bb5 Revert "(size_trunc_len): align to properly use either IEC or SI prefixes with the unit B (byte)."
This reverts commit bae814d0d4.
2016-11-08 13:19:37 +03:00
Andrew Borodin e3d457eb3d Revert "Ticket #3666: (size_trunc_len): fix segfault because of small buffer usage."
This reverts commit 3024f309c2.
2016-11-08 13:19:29 +03:00
Michael Osipov 3024f309c2 Ticket #3666: (size_trunc_len): fix segfault because of small buffer usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-11-06 18:30:41 +03:00
Michael Osipov bae814d0d4 (size_trunc_len): align to properly use either IEC or SI prefixes with the unit B (byte).
Additionally always put a space between number and unit which is
required by the norms.

It is important to note that really small buffers have to be bigger than it
appears because they store bytes and non-Latin scripts need more than one byte
with UTF-8 to encode them, e.g., the string "1023 МиБ" in Russian requires
11 bytes + null terminator.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-10-26 13:33:12 +03:00
Michael Osipov b3867a6e15 Ticket #3666: Improper use of IEC and SI prefixes for size in size_trunc().
size_trunc() has been aligned to properly use either IEC or SI prefixes with
the unit B (byte). Additionally always put a space between number and unit
which is required by the norms.

Obsolete gettext message ids have been removed and some cleaned up for
duplicate words or leading spaces.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-10-26 13:33:12 +03:00
Andrew Borodin 2151edaff2 Get rid of global variables mc_main_config and mc_panels_config.
Use mc_global.main_config and mc_global.panels_congig instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin 28ce7e566e (load_mc_home_file): return data length.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +03:00
Andrew Borodin 8fc0e1d76d Ticket #2673: support LZIP compression.
Thanks Matias A. Fonzo <selk at dragora.org> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-28 16:45:36 +03:00
Andreas Mohr b5ccd12d32 Ticket #3523: support lz4 compress format.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-02 14:02:08 +03:00
Andrew Borodin 471ea781ca Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:10 +03:00
Andrew Borodin fd4d25ae27 (strip_ctrl_codes): add missing default case.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 20:12:18 +03:00
Andrew Borodin 2789e6e390 Ticket #3431: add missing default cases.
Introduce -Wswitch-default check.

Some minor cosmetics.

Thanks Andreas Mohr <and at gmx dot li> for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:50 +03:00
Andreas Mohr e9e6868789 is_7bit_printable() is used only if support of charset selection and conversion is disabled. 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
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 ce568de9b9 (name_quote): refactoring
...and related modifications.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-12-10 12:57:47 +03:00
Andrew Borodin 89621050e3 (mc_time_elapsed): add new function to detect elapsed time intervals.
The author of initial patch is Egmont Koblinger.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-10-03 13:19:25 +04:00
Egmont Koblinger a3d75ae300 Ticket #3241: colon was not recognized inside escape seq in prompt.
export PS1=$'\[\e[38:5:214m\]orange$\[\e[0m\]'
mc

Expected: "orange$" prompt shows up in black under the panels.
Actual: some additional garbage.

The 256-color and true-color escape sequences should allow either ';' or
':' inside as separator, actually, ':' is the more correct according to
ECMA-48. Some terminal emulators (e.g. xterm, gnome-terminal) support
this.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-03 11:31:14 +04:00
Andrew Borodin 6d82155270 Massive use of MC_PTR_FREE macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-02 15:32:36 +04:00
Slava Zanko 512ad7d962 Make working with GError in more right way (like with exceptions).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2014-07-22 13:12:07 +04:00
Andrew Borodin 8c040b46b8 (x_basename): fix dereference of null pointer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +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
Slava Zanko 0ed4a91d7d Reduce cppcheck warnings (style) in lib subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Veres Lajos 805703523d Misspellings fixes by https://github.com/vlajos/misspell_fixer
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-15 11:10:41 +04:00
Andrew Borodin 5b1982a6bb (strip_ctrl_codes): type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-08 18:06:55 +04:00
Andrew Borodin d83902e7fc (size_trunc_len): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-07 13:06:51 +04:00
Andrew Borodin ceff7c5922 size_trunc_len() generates incorrect result in some cases.
Revert "(size_trunc_len): support automatic maximum unit for specified size."
This reverts commit ef94b84eaf.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-07 12:12:34 +04:00
Slava Zanko 2640b21bb9 Remove vfs_path_to_str() function for avoid often memory allocations.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-03 14:21:01 +03:00
Andrew Borodin ef94b84eaf (size_trunc_len): support automatic maximum unit for specified size.
Fix typos.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:19 +04:00
Slava Zanko 6447c76cca Implementation of getting last editing/viewing position of file.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Slava Zanko ee8aaf6181 Avoid compiler errors like: error: variable 'xxx' set but not used [-Werror=unused-but-set-variable]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-01-17 15:21:35 +03:00
Andrew Borodin 6cd19ea6cb Remove irrelevant comments about file_date() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-01-16 14:34:34 +04:00
Andrew Borodin 17cadc50ec Portability: use g_ascii_strtoll instead of strtoll, atoll and atof.
Set minimal version of GLib up to 2.12 because of g_ascii_strtoll.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:35 +04: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
Andrew Borodin 6c94ef16ec Refactoring of endless loops and some type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-10-21 18:19:52 +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 acdac76a49 Revert "Try fix of compile warnings about assigned but unused variables"
This reverts commit 6505f7d6fa.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-18 12:03:31 +04:00
Slava Zanko 94bd4b1f78 Code indentation.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-07-17 17:04:05 +04:00
Slava Zanko 6505f7d6fa Try fix of compile warnings about assigned but unused variables
...as returned values of functions declared with attribute
warn_unused_result [-Wunused-result].

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-07-17 17:04:05 +04:00
Andrew Borodin 038b5e7406 Ticket #2787: crash when creating relative symlink.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-04-25 14:55:56 +04:00
Andrew Borodin b1bcf6b01f (resolve_symlinks): use (vfs_path_t *) as argument.
Minor optimization of resolve_symlinks() and diff_two_paths().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-04-22 11:25:11 +03:00
Slava Zanko 2b5c28b316 Changes to handle vfs_path_t object:
* removed strip_password () function;
 * Added new vfs_path flag: VPF_HIDE_CHARSET;
 * added vfs_path_add_element() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:31 +03:00
Slava Zanko 8562a215be Code refactoring: removed concat_dir_and_file() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:30 +03:00