[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-diffutils] [patch] --ignore-file-name-case
From: |
Paul Eggert |
Subject: |
Re: [bug-diffutils] [patch] --ignore-file-name-case |
Date: |
Thu, 04 Aug 2011 07:14:41 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 |
That looks like a reasonable minor change to put in.
However, the documentation clearly states that
--ignore-file-name-case applies only to recursive
directory traversal, so this would be an incompatible
change to diff's behavior, and we'd need to change
the documentation and put in a NEWS entry.
I can see some possible improvements to the code:
The subscript should be of type size_t, not int, so
that it won't mess up on 64-bit hosts with very large
directories. Or better yet, use a char **p iterator
and dispense with the subscript entirely, like this:
for (p = dirdata.names; *p; p++)
[ use *p here, not dirdata.names[i] ]
Instead of "if (X) free (X);", write just "free (X);".
We no longer worry about ancient 'free' implementations
that can't free (0).
The "if (ignore_file_name_case)" test should be inside
find_dir_file_pathname, not in its caller. That way,
there needs to be only one call to 'concat', not two
calls in different files.