bug-gnulib
[Top][All Lists]
Advanced

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

Re: [patch] glob. If pattern has a trailing slash match directories only


From: Dmitry Goncharov
Subject: Re: [patch] glob. If pattern has a trailing slash match directories only
Date: Sun, 10 Nov 2019 12:17:36 -0500

Good morning.


On Sat, Nov 9, 2019 at 8:13 PM Bruno Haible <address@hidden> wrote:
> Are these issues supposed to be fixed in the new patch?
yes.

>  (I appreciate that you add tests!):
It is easier to write a test program than to test glob manually.

>   - Please follow GNU coding style, esp. regarding space between a function
>     name and its arguments:
>       int rc = symlink (old, new);
Done.

>   - Similarly, add spaces around operators:
>       GLOB_MARK | GLOB_ONLYDIR
Done.

>   - The functions touch, md, ln, ln_s all return 0; better change the return
>     type to 'void'.
Done

>   - Why is 'verbose' an 'int'?
Personal preference.

> Couldn't it be a 'bool'?
Changed to bool.


1. To reproduce that a pattern with a trailing slash fails to filter
out files you'll libc with dirent that has no type field. That could
be an old glibc or sunos or aix libc.
2. You can use any libc to reproduce that GLOB_ONLYDIR fails to filter
out symlinks to files.

Thanks for review.

regards, Dmitry

Attachment: match_slash_explicitly2.diff
Description: Text Data


reply via email to

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