texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Patrice Dumas
Date: Mon, 23 Dec 2024 17:44:49 -0500 (EST)

branch: master
commit 5e6d3feacb963866bbe3fa4d5cdcb1e131401911
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Dec 7 00:27:46 2024 +0100

    * tp/texi2any.pl: when parsing -c/--set-customization-variable,
    determine the variable name before checking if the value should be
    decoded.
---
 ChangeLog                                                     |  6 ++++++
 .../encoded/res_parser/non_ascii_command_line/os%c3%a9_utf8.2 |  2 +-
 tp/texi2any.pl                                                | 11 +++++------
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b8270175d1..13faf4850f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-12-06  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/texi2any.pl: when parsing -c/--set-customization-variable,
+       determine the variable name before checking if the value should be
+       decoded.
+
 2024-12-06  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Config.pm (_GNUT_document_warn, _GNUT_document_fatal)
diff --git a/tp/tests/encoded/res_parser/non_ascii_command_line/os%c3%a9_utf8.2 
b/tp/tests/encoded/res_parser/non_ascii_command_line/os%c3%a9_utf8.2
index 66a8151094..689df1534a 100644
--- a/tp/tests/encoded/res_parser/non_ascii_command_line/os%c3%a9_utf8.2
+++ b/tp/tests/encoded/res_parser/non_ascii_command_line/os%c3%a9_utf8.2
@@ -1,6 +1,6 @@
 texi2any: warning: Mekanïk is not a valid split possibility
 texi2any: warning: Destruktïw is not a valid language code
-texi2any: warning: unknown variable from command line: Kommandöh
+texi2any: warning: unknown variable from command line: Kommand
 osé_utf8.texi:26: @include: could not find not_existïng.téxi
 osé_utf8.texi:22: warning: @image file `txt_çimage' (for HTML) not found, 
using `txt_çimage.jpg'
 osé_utf8.texi:24: warning: @image file `dîrectory/imàge' (for HTML) not found, 
using `dîrectory/imàge.êxt'
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 9be65b3918..004d07c592 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1246,17 +1246,16 @@ There is NO WARRANTY, to the extent permitted by 
law.\n"), "2024");
     }
  },
  'set-customization-variable|c=s' => sub {
-   my $var_val;
-   if ($Texinfo::Common::non_decoded_customization_variables{$_[1]}) {
-     $var_val = $_[1];
-   } else {
-     $var_val = _decode_input($_[1]);
-   }
+   my $var_val = $_[1];
+   # the string is a byte string, so \w should correspond to ASCII
+   # characters only, which is good
    if ($var_val =~ s/^(\w+)\s*=?\s*//) {
      my $var = $1;
      my $value = $var_val;
      if ($value =~ /^undef$/i) {
        $value = undef;
+     } elsif (!$Texinfo::Common::non_decoded_customization_variables{$var}) {
+       $value = _decode_input($var_val);
      }
      # TODO verify that it is the best.  It is inconsistent with other
      # customization options that have the same precedence as command



reply via email to

[Prev in Thread] Current Thread [Next in Thread]