Commit Graph

15261 Commits

Author SHA1 Message Date
Andreas Mohr 1bdf814052 (mc_setup_by_args): reduce variable scope into #ifdef to fix coverity finding.
Found by Coverity.
Coverity id #331837

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 5b4ec9b033 (translate_file): refactoring.
Allocate buffer only if charset converter is created successfully.
g_string_free() returns NULL if second argument is TRUE. Use that to get
rig of 'if' statement.
Reduce variable scope.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin a6c142ed48 (get_random_hint): refactoring.
g_string_free() returns NULL if second argument is TRUE. Use that to get
rig of 'if' statement.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin c83f989a11 Fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 4518885f93 (dir_list_load): rename argument: fltr -> filter.
(dir_list_reload): likewise.
(handle_dirent): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 2101026d4c (show_version): display version of libssh2.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin bb42ed706c (sftpfs_read_known_hosts): clarify displayed value of unknown host key type.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 7408272361 filevercmp: fix several unexpected results.
Sync with gnulib 9f48fb992a3d7e96610c4ce8be969cff2d61a01b.
Problems reported by Michael Debertol in <https://bugs.gnu.org/49239>.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin d00a1c22b9 tests/lib/strutil/filevercmp.c: use _GL_CMP() to get sign.
tests/lib/strutil/str_verscmp.c: likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 39e7a048f7 tests/lib/strutil/filevercmp.c: minor improvements.
Use ck_assert_int_lt() and ck_assert_int_gt() to check integer values.

Increase minimal version of Check up to 0.9.10.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 4f22598c9a Tests: clarification of boolean values tests.
Use mctest_assert_true and mctest_assert_false macros to check boolean
values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin f411d44fea Tests clean up.
Remove mc-specific macros mctest_assert_int_eq and mctest_assert_int_ne.
Use ck_assert_int_eq() and ck_assert_int_ne() functions respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin f0924b954d (file_mask_dialog): refactoring: get rid of goto.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andreas Mohr 2087ede32d (file_mask_dialog): NULLify variables before use in next iteration.
Found by Coverity.
Coverity id #331828
Coverity id #331850

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 09de50d3a1 (_str_convert): fix memory leak.
Found by Coverity.
Coverity id #348334.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 9f53bf5617 Include <stddef.h> where ptrdiff_t is used.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 185c80ffb7 Ticket #4330: doc/INSTALL clean up.
Removed description of S-Lang related options that were removed
in 0a26014ca4.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 2c205c5928 Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 67542c64b2 Add script to update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:24 +03:00
Andreas Mohr 9489b5edc4 Remove unused macros.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andreas Mohr 1bc8abd79f configure.ac: replace obsolete AC_PROG_CC_STDC macro.
Since release 2.70 of GNU Autoconf

> *** AC_PROG_CC_STDC, AC_PROG_CC_C89, AC_PROG_CC_C99 are now obsolete.
>  Applications should use AC_PROG_CC.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andrew Borodin dc7888ca97 doc/man/ru/mc.1.in: fix stale links.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andrew Borodin ca24b1d136 (ftpfs_check_proxy): read mc.no_proxy file once only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andrew Borodin 76555ad40d man: much use of directory macros.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andrew Borodin d07abec4c3 (swap_panels): swap panel sort modes too.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andrew Borodin 98932f51f4 lib/filehighlight/get-color.c: remove extra parenthesis.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andrew Borodin c70658ee55 Ticket #4270: code clean up before 4.8.28 release.
lib/filehighlight/get-color.c: constify function arguments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:23 +03:00
Andrew Borodin cbcda8a284 file highlighting: add PSD graphical format.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-01-16 21:23:31 +03:00
Andrew Borodin e672a0e72d Ticket #4328: file highlighting: add more graphical formats.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-01-16 16:49:48 +03:00
Andrew Borodin 25e7c080a0 Merge branch '4326_isoinfo'
* 4326_isoinfo:
  Ticket #4326: iso9660: fix isoinfo check.
2022-01-16 16:45:50 +03:00
Andrew Borodin d8b9589224 Ticket #4326: iso9660: fix isoinfo check.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-01-09 18:17:24 +03:00
Alexandros Diamantidis 9bf247805a Ticket #4325: support Shift+Fn keys for KiTTY.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-01-05 16:01:01 +03:00
Andrew Borodin f7c52474fb Merge branch '4323-info_segfault'
* 4323-info_segfault:
  Ticket #4323: fix segfault on change panel mode.
2022-01-05 15:53:14 +03:00
Andrew Borodin 13df437ba1 Ticket #4323: fix segfault on change panel mode.
How to reproduce:
1. Set left panel to list mode.
2. Make left panel active.
3. Change left panel to info mode.
Result: segmentation fault.

(widget_replace): fix search of the next focusable widget.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-24 16:36:38 +03:00
Grzegorz Szymaszek d0cc71e48a Ticket #4322: add basic DOT/Graphviz syntax highlighting.
DOT is a graph description language, described at
<https://graphviz.org/doc/info/lang.html>. The new syntax file
recognizes the basic language keywords and syntax; known node,
edge, graph, etc. properties; comments; character strings.

The syntax file seems to work well with various DOT files found
in the Linux kernel sources as well as with the MNT Reform 2.0D-4
System Diagram.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-20 20:51:43 +03:00
Andrew Borodin fa0b6f9f93 Ticket #3146: fix typo in skin files: s/scollbar/scrollbar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-18 15:52:33 +03:00
Grzegorz Szymaszek d5481d2684 Ticket #4319: fix SPICE syntax file to recognize where control script context ends
Since .endc was defined both as the context end delimiter and a context
keyword, it was not recognized as the former and the control script
context, once started, would never be finished. This issue can be
noticed, for example, in wrong syntax highlighting of the .end command
if it was preceded by a control script.

Fix the issue by making the control script context exclusive and
highlighting the .control and .endc keywords in the default context
instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-05 16:31:41 +03:00
Grzegorz Szymaszek 52d9d7946f Ticket #4316: add basic Ngspice syntax highlighting.
Add basic support for highlighting Ngspice/SPICE (http://ngspice.sourceforge.net/)
circuit description files syntax. Two main contexts are defined:
- the default context, where the circuit is described,
- the control script context (between .control and .endc).

The default context highlights dot commands, circuit element instance
names and model types. The control script context highlights supported
functions/commands and known variables. Both contexts highlight comments
and line continuation marks.

Other than two FIXMEs, it is a known issue the first line of the file is
part of the default context, while in most cases it would contain the
file title.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-12-04 07:13:23 +03:00
Andrew Borodin eff779b246 Merge branch '4270_cleanup'
* 4270_cleanup: (33 commits)
  Upate po/*.po files.
  mc.lib: move xterm alt-shift-arrow definitions to lib/tty/key.c.
  mc.lib: [terminal:linux] is same as [terminal:console].
  (delete_region, copy_region): rename arguments.
  src/editor/editwidget.c: grammar.
  mceditor: use MB_LEN_MAX constant.
  (string_file_name): use mc_g_string_copy.
  (complete_engine, insert_text): don't calculate text length twice.
  lib/strutil/strutilutf8.c: use MB_LEN_MAX constant.
  Remove get_process_stats() test.
  Use g_get_monotonic_time() instead of g_get_real_time().
  (learn_key): return NULL if buffer is empty.
  (learn_key): use g_get_real_time () to simplify time comparision.
  (get_key_code): use g_get_real_time () to simplify time comparision.
  (xmouse_get_event): use g_get_real_time () to simplify time comparision.
  lib/tty/key.c: use named constants for time intervals.
  (file_mask_dialog): indentation.
  Reimplement compiler options checking.
  lib/util.c: remove unneeded include.
  lib/keybind.h: remove unneeded includes.
  ...
2021-11-21 15:19:38 +03:00
Andrew Borodin 9707afc084 Upate po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:19:19 +03:00
Andrew Borodin a73886ef90 mc.lib: move xterm alt-shift-arrow definitions to lib/tty/key.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin b6c8f319e9 mc.lib: [terminal:linux] is same as [terminal:console].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 9149a6d132 (delete_region, copy_region): rename arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 529c7d70dd src/editor/editwidget.c: grammar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 19591c4475 mceditor: use MB_LEN_MAX constant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin a147082c73 (string_file_name): use mc_g_string_copy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 8010b08584 (complete_engine, insert_text): don't calculate text length twice.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin e71972003e lib/strutil/strutilutf8.c: use MB_LEN_MAX constant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin ccbac47385 Remove get_process_stats() test.
The GLib API is used for measurement of time intervals.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00
Andrew Borodin 4e8b00f003 Use g_get_monotonic_time() instead of g_get_real_time().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 15:00:39 +03:00