On 24/08/2025 13:04, Bruno Haible wrote:
Hi Pádraig,
What is your position regarding these three approaches today? Or do you see
another approach, in order to avoid code duplication while keeping the code
maintainable?
For simple loops I think it's feasible to duplicate.
For more involved logic it's best to not duplicate.
Is the 'fnmatch' module approach, with a .h file that gets included twice,
acceptable
to you? That is, would it be OK to have a coreutils program be implemented
through
a .c file and a .h file for the core loop? Or do you insist on the code being
contained
in a single .c file?
The fnmatch approach looks very maintainable to me.
cheers,
Padraig