Re: m4p: an implementation of GNU m4 in Python

Jacob Bachmeyer <[email protected]> Sat, 10 May 2025 00:29:40 -0500
Newsgroups gmane.comp.sysutils.autoconf.general
Message-ID <[email protected]>
On 5/9/25 16:45, Nikolaos Chatzikonstantinou wrote:
> [...]
>
> I'm worried about:
>
> 1. What mode GNU m4 opens files in; m4p always open in binary,
> potentially treating carriage return differently on Windows.

A quick glance through the C code 
(<URL:http://git.savannah.gnu.org/cgit/m4.git/tree/src?h=branch-1.4>) 
confirms that at least the input files mentioned on the command line are 
opened in text mode.  (The process_file function in m4.c calls 
m4_path_search with the "binary" argument false.)

Searching the code for "m4_path_search" and examining how each call to 
that function is reached should answer your questions on this topic.


-- Jacob