Commit Graph

15574 Commits

Author SHA1 Message Date
Evgeny Grin
1d7d9a832e Ticket #4466: fix sed usage in po/Makefile.
'po' directory does not use automake assignment.

This is a correction for f45d02ba2a.

Closes MidnightCommander/mc#191.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-21 20:24:38 +03:00
Andrew Borodin
b90177fa10 Merge branch '4465_ncurses_libs'
* 4465_ncurses_libs:
  Ticket #4465: remove duplicated libs from MCLIBS (again).
2023-05-21 20:17:18 +03:00
Evgeny Grin
8fba56d40f Ticket #4465: remove duplicated libs from MCLIBS (again).
Fixed copy-paste error.
This is a correction for 92ae4c6b20.

Closes MidnightCommander/mc#190.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-21 20:15:30 +03:00
Andrew Borodin
f17ebfd2a5 Merge branch '4463_ncurses_libs'
* 4463_ncurses_libs:
  Ticket #4463: ncurses library is duplicated in MCLIBS.
2023-05-20 20:59:44 +03:00
Evgeny Grin
92ae4c6b20 Ticket #4463: ncurses library is duplicated in MCLIBS.
AC_SEARCH_LIBS macro adds required library to 'LIBS' variable.
Currently 'LIBS' could be appended to 'MCLIBS' several times leading to
duplication of found values.
Also fixed duplication for 'stdscr' function detection.
Additionally fixed potential problematic situation when 'addwstr' or
'has_colors' detected in one ncurses library (for example 'ncurses'),
while 'stdscr' detected in other ncurses library (for example 'curses').
Such combination leads to problems.

Closes MidnightCommander/mc#187.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 20:54:50 +03:00
Andrew Borodin
5c9a145c3d Merge branch '4462_ncurses_includes'
* 4462_ncurses_includes:
  Ticket #4462: FTBFS if ncurses used without --with-ncurses-includes= configure parameter.
2023-05-20 20:47:47 +03:00
Evgeny Grin
1f732f0a14 Ticket #4462: FTBFS if ncurses used without --with-ncurses-includes= configure parameter.
If ncurses location is not specified by configure parameters like
'--with-ncurses-includes=/some/dir' then automatic detection at compiler
default location is used. With automatic detection the header
'ncurses/term.h' is not checked therefore macro HAVE_NCURSES_TERM_H is
not defined.

Closes MidnightCommander/mc#186.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 20:42:48 +03:00
Andrew Borodin
08be8094ca Merge branch '4460_makefile'
* 4460_makefile:
  Ticket #4460: fix unportable '$<' in Makefiles.
2023-05-20 20:23:41 +03:00
Evgeny Grin
8cd913a28a Ticket #4460: fix unportable '$<' in Makefiles.
POSIX specifis '$<' only for "inference" rules (i.e. general rule
like '.c.o:'), while for "target" is undefined.
It is supported as extension for targets by some "make" implementations,
but not all.
The workarounds could be easily used.

Closes MidnightCommander/mc#185.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 20:18:58 +03:00
Andrew Borodin
2e3e3a3775 Merge branch '4459_sed'
* 4459_sed:
  Replaced unportable 'inplace' sed command
  Use configure detected or user specified sed in build system
  Ticket #4459: usage of 'sed' in build system/makefiles is not portable.
2023-05-20 20:06:54 +03:00
Evgeny Grin
68e6d960f8 Replaced unportable 'inplace' sed command
'-i' sed option is not portable, not specified by POSIX and does not
work on same platforms.
Replaced with simple and obvious workarounds.

Closes MidnightCommander/mc#184.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 19:57:23 +03:00
Evgeny Grin
f45d02ba2a Use configure detected or user specified sed in build system
Sometimes system default sed is not the best option.
With this modification user may easily override sed used by build system
without editing any file.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 19:56:53 +03:00
Evgeny Grin
054a051b42 Ticket #4459: usage of 'sed' in build system/makefiles is not portable.
configure: add explicit sed detection

Actually SED variable is set automatically by LT_INIT currently.
Having explicit check should help avoiding problems if/when LT_INIT
changed.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 19:56:32 +03:00
Andrew Borodin
e5911c1ef5 Merge branch '1952_tar'
* 1952_tar:
  tar: add support of extended headers.
  struct vfs_s_inode: add the 'user_data' member.
  tar: prepare to support the POSIX extended headers.
  tar: refactoring of archive reading.
  (tar_read_header): move entry/inode creation to new function tar_insert_entry().
  tar: use separate structure to store various file info.
  (tar_read_header): minor optimization.
  (tar_read_header): rename variable.
  (tar_find_next_block): rename from tar_get_next_block.
  src/vfs/tar/tar.c: remove period from error messages.
  (tar_read_header): rename variables.
  (tar_get_next_block): use file descriptor from archive descriptor.
  (tar_open_archive_int): return status of tar archive open
  src/vfs/tar/tar.c: clarify support of OLDGNU format.
  (tar_decode_header): do not decode size here.
  Ticket #1952: tar: support long file names in archive.
2023-05-20 19:45:28 +03:00
Andrew Borodin
8d1427d183 tar: add support of extended headers.
Most of the code is taken from GNU tar.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-01 13:07:29 +03:00
Andrew Borodin
290a57b474 struct vfs_s_inode: add the 'user_data' member.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-01 13:04:41 +03:00
Andrew Borodin
ffe6412c30 tar: prepare to support the POSIX extended headers.
Move required stuff to tar-internal.{ch} files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-01 13:04:29 +03:00
Andrew Borodin
8223f82857 tar: refactoring of archive reading.
Make it close to GNU tar imlementation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-01 13:02:57 +03:00
Andrew Borodin
4158824d70 (tar_read_header): move entry/inode creation to new function tar_insert_entry(). 2023-05-01 13:02:57 +03:00
Andrew Borodin
c35dfc3363 tar: use separate structure to store various file info.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-01 13:02:57 +03:00
Andrew Borodin
d4d0fe6019 (tar_read_header): minor optimization.
Calculate length of file and link name if that is really needed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-01 13:02:42 +03:00
Andrew Borodin
d4ded63724 (tar_read_header): rename variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:57 +03:00
Andrew Borodin
07a0aa352d (tar_find_next_block): rename from tar_get_next_block.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:57 +03:00
Andrew Borodin
3ed39fb883 src/vfs/tar/tar.c: remove period from error messages.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:56 +03:00
Andrew Borodin
3a9524979c (tar_read_header): rename variables.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:56 +03:00
Andrew Borodin
96ebde8d68 (tar_get_next_block): use file descriptor from archive descriptor.
(tar_skip_n_records): likewise.
(tar_read_header): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:56 +03:00
Andrew Borodin
74c16acf6a (tar_open_archive_int): return status of tar archive open
... instead of file descriptor.

(tar_open_archive): remove variable stored file descriptor. Use file
descriptor from archive descriptor.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:56 +03:00
Andrew Borodin
35e548b054 src/vfs/tar/tar.c: clarify support of OLDGNU format.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:56 +03:00
Andrew Borodin
d647914bfb (tar_decode_header): do not decode size here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:51:56 +03:00
Andrew Borodin
78a25f7800 Ticket #1952: tar: support long file names in archive.
Initial changeset: tar.c: update code to be close to GNU tar.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-04-23 20:49:41 +03:00
Andrew Borodin
86a9e0be2c Merge branch '4450_pcre2'
* 4450_pcre2:
  Ticket #4450: support PCRE2 in the search engine.
2023-04-02 20:53:23 +03:00
Andrew Borodin
49624e473b Ticket #4450: support PCRE2 in the search engine.
* m4.include/ax_path_lib_pcre.m4: replace by recent version from GNU
Autoconf Archive.
  * m4.include/ax_check_pcre2.m4: get grom GNU Autoconf Archive.
  * m4.include/mc-check-search-type.m4: support both PCRE versions.
  * */*/Makefile.am: remove @CHECK_CFLAGS@ and @PCRE_LIBS@ ads they are
added via AX_PATH_LIB_PCRE and AX_CHECK_PCRE2.
  * lib/search.h, lib/search/: add support of PCRE2. Thanks broly <gagan@hotmail.com>
for the initial patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-25 10:07:41 +03:00
Andrew Borodin
be3822cafa Merge branch '4426_cleanup'
* 4426_cleanup: (38 commits)
  Update po/*.po files.
  (edit_find_editor): rename from find_editor.
  Listbox window: rename functions.
  (buttonbar_find): rename from find_buttonbar.
  Menu: rename functions.
  (advanced_chown_cmd): use intermediate variables to make text more readable.
  Use mc_fgetflags() and mc_fsetflags() where needed.
  VFS: mc_fgetflags, mc_fsetflags: new APIs.
  Minor optimization of chown/chmod/chattr operations.
  (operate_single_file): clarify creation of file operation UI.
  (dlg_default_destroy): send MSG_DESTROY to the dialog itself
  Collect all editor options to structure.
  Add EDIT and CONST_EDIT macros.
  usermenu: clarify compilation w/o internal editor.
  src/editor/spell.c: add missed #include.
  Update template for .c files.
  (do_search): remove intermediate variable.
  (do_search): get rid of string duplication.
  Change WDialog::data from void* to union{void*, int}
  Don't create an empty string in WLabel objects.
  ...
2023-03-19 20:40:09 +03:00
Andrew Borodin
acedeff17a Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:39:51 +03:00
Andrew Borodin
a286f042d4 (edit_find_editor): rename from find_editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
c157b048e5 Listbox window: rename functions.
create_listbox_window -> listbox_window_new
create_listbox_window_centered -> listbox_window_new_centered
run_listbox -> listbox_run
run_listbox_with_data -> listbox_run_with_data

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
d9383ba8b3 (buttonbar_find): rename from find_buttonbar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
fd2d5b49ac Menu: rename functions.
menu_entry_create -> menu_entry_new
menu_separator_create -> menu_separator_new
create_menu -> menu_new
destroy_menu -> menu_free
find_menubar -> menubar_find

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
a242e8b91f (advanced_chown_cmd): use intermediate variables to make text more readable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
79c8a351ba Use mc_fgetflags() and mc_fsetflags() where needed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
2a6580127a VFS: mc_fgetflags, mc_fsetflags: new APIs.
(mc_fgetflags): fgetflags(3) VFS wrapper.
(mc_fsetflags): fsetflags(3) VFS wrapper.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
50f4717f45 Minor optimization of chown/chmod/chattr operations.
(try_chmod): create filename when required.
(try_chown): likewise.
(try_advanced_chown): likewise.
(try_chattr): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
6329771fc0 (operate_single_file): clarify creation of file operation UI.
Create UI to show confirmation dialog in case of foreground operation
regardless of ENABLE_BACKGROUND.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
47da3a764a (dlg_default_destroy): send MSG_DESTROY to the dialog itself
...to avoid various memory leaks.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
8a951746b3 Collect all editor options to structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
d2b9454f4b Add EDIT and CONST_EDIT macros.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
683122482b usermenu: clarify compilation w/o internal editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andreas Mohr
de1edb72f8 src/editor/spell.c: add missed #include.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
7257f794d2 Update template for .c files.
Add section for forward declarations of local functions. This section is
located before file scope variables because functions can be used in
strucutres (see find.c for example):

/*** forward declarations (file scope functions) *************************************************/

/* button callbacks */
static int start_stop (WButton * button, int action);
static int find_do_view_file (WButton * button, int action);
static int find_do_edit_file (WButton * button, int action);

/*** file scope variables ************************************************************************/

static struct
{
    ...
    bcback_fn callback;
} fbuts[] =
{
    ...
    { B_STOP, NORMAL_BUTTON, N_("S&uspend"), 0, 0, NULL, start_stop },
    ...
    { B_VIEW, NORMAL_BUTTON, N_("&View - F3"), 0, 0, NULL, find_do_view_file },
    { B_VIEW, NORMAL_BUTTON, N_("&Edit - F4"), 0, 0, NULL, find_do_edit_file }
};

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
e1ff8d94e4 (do_search): remove intermediate variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:23 +03:00