bug-gnulib
[Top][All Lists]
Advanced

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

Re: WIP patch to reduce rewrite_filename duplication


From: Collin Funk
Subject: Re: WIP patch to reduce rewrite_filename duplication
Date: Thu, 25 Apr 2024 15:55:04 -0700
User-agent: Mozilla Thunderbird

Hi Bruno,

On 4/25/24 1:18 PM, Bruno Haible wrote:
> Yep, that's the right way to do it. Maybe file_name should come first
> (by the usual heuristic that the argument that shows most variation
> comes first)?

Sure, that is fine with me. I think the other way is based on how I
like to write C. Usually I like to place structures (or pointers to
them) first. The best example I can think of off the top of my head
is:

    int fprintf (FILE *stream, const char *format, ...);

vs.

   int fputs (const char *str, FILE *stream);

I always feel awkward using 'fputs' because of that. But that is a
different language so I can adapt. :)

How does this patch look? I'll wait for you to review it before
pushing any changes.

I ran all tests with Python 3.7 and they pass. I don't think
gnulib-tool --copy-file is tested there though. I tried to use gettext
since I remember autogen.sh does it a few times but I see the
following failure:

$ cd gettext
$ env GNULIB_TOOL_IMPL=sh+py sh -x ./autogen.sh
[...]
Copying file gnulib-lib/exitfail.c
1 out of 1 hunk FAILED -- saving rejects to file /tmp/glDMpS4d/exitfail.h.rej
/home/collin/.local/src/gnulib/gnulib-tool.sh: *** patch file 
gnulib-local/lib/exitfail.h.diff didn't apply cleanly
/home/collin/.local/src/gnulib/gnulib-tool.sh: *** Stop.
+ exit 1

I assume that is unrelated to these changes and will be an easy fix
for you. When I remove the diff everything passes with
GNULIB_TOOL_IMPL=sh+py.

Collin

Attachment: 0001-gnulib-tool.py-Reduce-code-duplication-in-file-name-.patch
Description: Text Data


reply via email to

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