Commit Graph

10 Commits

Author SHA1 Message Date
Andrew Borodin 44d8213f4e Ticket #4533: External editor does not work with arguments in $EDITOR
When using an external editor (i.e. "Use internal edit" in the Configure
Options is unchecked) the environment variable EDITOR is used. However,
if $EDITOR contains a command line argument after the executable name,
these arguments are not processed properly, and the editor might not be
started at all.

How to reproduce: (Precondition: vi is available on the system)
  1) On the command line, execute: export EDITOR="vi +" && mc
(the + argument should let vi start at the document's end instead of the
beginning).
  2) Go to the Options menu -> Configuration -> uncheck "Use internal
edit".
  3) Move the cursor to a file that is larger than a single screen (e.g.
ABOUT-NLS in mc's source directory).
  4) Press F4 to start the external editor.

Result: Nothing visible happens

Expected result: vi is opened showing the end of the file ABOUT-NLS

The bug: my_system_make_arg_array() doesn't perform full-feature
parsing of the comman line.

  * (str_tokenize): mew function based on history_tokenize_internal()
from GNU readline-8.2.
  * (str_tokenize_word): mew function based on history_tokenize_word()
from GNU readline-8.2.
  * (my_system_make_arg_array): reimplement using str_tokenize().
  * (my_systemv_flags): use modified my_system_make_arg_array().
  * (fork_child_tokens): new test for string tokenization.
  * (fork_child_tokens2): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-31 19:04:26 +03:00
Andrew Borodin a2a5fa017e Fix file version sort.
Use filevercmp() instead of str_verscmp().
Source code of filevercmp() is taken from Gnulib.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-03-02 11:24:07 +03:00
Andrew Borodin ccf82ada12 Add functions to transform string to unsigned integer:
* (xstrtoumax): from gnulib.
 * (parse_integer): from coreutils (dd.c).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-05 09:09:03 +04:00
Slava Zanko 808988b1f1 Add lib/strutil/replace:str_replace_all() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Andrew Borodin 60727b9b79 Clarify usage of AM_CPPFLAGS.
Use AM_CPPFLAGS not AM_CFLAGS for includes. GLIB_CFLAGS are CPPFLAGS, actually.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-18 16:27:49 +04:00
Andrew Borodin b37af47023 Makefile.ams cleanup.
Set defines via CPPFLAGS variable not via CFLAGS one.
Use AM_CPPFLAGS and AM_CFLAGS variables instead of per-target ones.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-17 17:04:05 +04:00
Vladimir Brednikov 3c4221bc40 Ticket #1994: Sort files by version (like strverscmp(3) does)
Suppose we have 3 files with version in their names:
 * file-2.1.tgz
 * file-2.2.tgz
 * file-2.10.tgz

It is impossible to see them in natural order using standard facilities,
they will be sorted in alphabet order:
 * file-2.1.tgz
 * file-2.10.tgz
 * file-2.2.tgz

There was some attempts to fix this. I've picked up the patch by Roland Illig <roland illig gmx de>
(http://mail.gnome.org/archives/mc-devel/2004-July/msg00016.html) and adopted it for today's git snapshot.
It adds "version" option to the sort menu, which uses copy of strverscmp function from glibc.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-22 11:08:37 +02:00
Slava Zanko 2fa4d9b952 Move logging.[ch] into library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko e07ba16b3b Moved strecape.[ch] into library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko cd4dbf3a09 Changes for build after moving strutil into lib
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00