[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sat, 18 Jan 2025 18:50:03 -0500 (EST) |
branch: master
commit 89d87ab09d70f95257e201319f0ad064393456ed
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 19 00:43:00 2025 +0100
* tp/Texinfo/XS/texi2any.c (long_options, main): set the default
program_file to be texi2any, use argv[0] only if --no-mimick is set.
---
ChangeLog | 5 +++++
tp/Texinfo/XS/texi2any.c | 16 ++++++++++------
tp/ctexi2any.pl | 2 +-
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 643ff927ca..2ac6bdfae6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-01-18 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/texi2any.c (long_options, main): set the default
+ program_file to be texi2any, use argv[0] only if --no-mimick is set.
+
2025-01-18 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/texi2any.c (main): set top_srcdir and tp_builddir only
diff --git a/tp/Texinfo/XS/texi2any.c b/tp/Texinfo/XS/texi2any.c
index 41176724c1..023ae107f7 100644
--- a/tp/Texinfo/XS/texi2any.c
+++ b/tp/Texinfo/XS/texi2any.c
@@ -772,7 +772,7 @@ static int print_help_p;
#define _FORMAT_OPT 21
#define XML_OPT 22
#define INTERNAL_LINKS_OPT 23
-#define MIMICK_OPT 24
+#define NO_MIMICK_OPT 24
#define XOPT_OPT 25
#define _SILENT_OPT 26
/* can add here */
@@ -804,7 +804,7 @@ static int print_help_p;
static struct option long_options[] = {
/* next not in texi2any */
- {"mimick", 0, 0, MIMICK_OPT},
+ {"no-mimick", 0, 0, NO_MIMICK_OPT},
{"conf-dir", required_argument, 0, CONF_DIR_OPT},
{"css-include", required_argument, 0, CSS_INCLUDE_OPT},
@@ -964,13 +964,16 @@ main (int argc, char *argv[], char *env[])
char *perl_embed_env;
char *texinfo_dev_source_env;
char *command_directories;
+ char *program_basename;
texinfo_dev_source_env = getenv ("TEXINFO_DEV_SOURCE");
parse_file_path (argv[0], program_file_name_and_directory);
- program_file = program_file_name_and_directory[0];
+ program_basename = program_file_name_and_directory[0];
command_directories = program_file_name_and_directory[1];
+ program_file = strdup ("texi2any");
+
if (texinfo_dev_source_env && strcmp (texinfo_dev_source_env, "0"))
texinfo_uninstalled = 1;
else
@@ -1291,9 +1294,9 @@ main (int argc, char *argv[], char *env[])
case XML_OPT:
set_cmdline_format ("texinfoxml");
break;
- case MIMICK_OPT:
+ case NO_MIMICK_OPT:
free (program_file);
- program_file = strdup ("texi2any");
+ program_file = strdup (program_basename);
GNUT_set_from_cmdline (&program_options,
cmdline_options.options->PROGRAM.number,
program_file);
@@ -3070,7 +3073,8 @@ main (int argc, char *argv[], char *env[])
free_strings_list (&input_files);
free_options_list (&parser_options);
- /* free (command_directory); */
+
+ free (program_basename);
free (program_file);
free_options_list (&cmdline_options);
diff --git a/tp/ctexi2any.pl b/tp/ctexi2any.pl
index a590cb92db..51b11a4f37 100755
--- a/tp/ctexi2any.pl
+++ b/tp/ctexi2any.pl
@@ -14,5 +14,5 @@ if (defined($top_srcdir)) {
$command_dir = $command_directory;
$ENV{'top_srcdir'} = "$command_dir/..";
}
-exec("${command_dir}/Texinfo/XS/ctexi2any", '--mimick', @ARGV);
+exec("${command_dir}/Texinfo/XS/ctexi2any", @ARGV);