[luatex] \openin with extensionless files.

Henri Menke henrimenke at gmail.com
Thu Jan 23 09:13:00 CET 2020


I just tested this patch and it seems to work.

--- a/source/texk/web2c/luatexdir/tex/maincontrol.c
+++ b/source/texk/web2c/luatexdir/tex/maincontrol.c
@@ -3824,8 +3824,6 @@ void open_or_close_in(void)
         if (cur_cmd != left_brace_cmd) {
             /*tex Set |cur_name| to desired file name. */
             scan_file_name();
-            if (cur_ext == get_nullstr())
-                cur_ext = maketexstring(".tex");
         } else {
             scan_file_name_toks();
         }

On 1/23/20 9:07 PM, luigi scarso wrote:
> On Wed, Jan 22, 2020 at 10:30 PM Henri Menke <henrimenke at gmail.com> wrote:
> 
>> I might have found the bug.  Compare this bit in open_or_close_in(void)
>>
>>     if (cur_cmd != left_brace_cmd) {
>>         /*tex Set |cur_name| to desired file name. */
>>         scan_file_name();
>>         if (cur_ext == get_nullstr())
>>             cur_ext = maketexstring(".tex");
>>     } else {
>>         scan_file_name_toks();
>>     }
>>
>> with this bit in start_input(void)
>>
>>     if (cur_cmd != left_brace_cmd) {
>>         /*tex Set |cur_name| to desired file name. */
>>         scan_file_name();
>>     } else {
>>         scan_file_name_toks();
>>     }
>>
>> In the former the extra branch
>>
>>     if (cur_ext == get_nullstr())
>>         cur_ext = maketexstring(".tex");
>>
>> does not make any sense actually because start_file_name does not set
>> cur_ext, which is therefore either going to be NULL or still set to the
>> last value.  I think it this branch were removed, the code would behave
>> correctly.
>>
> 
> Thank you fro the report, we will see it asap.
> Probably it makes sense to have a  luatex-specific code  in any case, to
> play safe with old versions of luatex.
> 


More information about the luatex mailing list