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.

Reply via email to