bug-cvs
[Top][All Lists]
Advanced

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

Re: possible bug with ignoring directories in module file


From: Mark D. Baushke
Subject: Re: possible bug with ignoring directories in module file
Date: Fri, 20 Aug 2004 22:51:33 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jim,

James E Wilson <address@hidden> writes:

> The GCC CVS repository has directories gcc/f, gcc/fixinc, gcc/fortran.
> We have a module defined in the modules file which has
>    !gcc/f
> When we check out this module, not only is the gcc/f directory removed,
> but also the gcc/fixinc and gcc/fortran directories.
>
> I see no explanation of this feature in the manual.  It appears to be a
> bug.

Hmmm.... it would appear to me to be a lack of explaination in the
manual.

I would sugest that the gcc.gnu.org:/gcc-cvs CVSROOT/modules file needs
to add a trailing '/' character to its directory names something like
this:

gcc-core -a \
        !gcc/gcc/testsuite/ \
        !gcc/gcc/ada/    !gcc/libada/ \
        !gcc/gcc/ch/     !gcc/libchill/ \
        !gcc/gcc/cp/     !gcc/libstdc++/  !gcc/libio/      !gcc/libstdc++-v3/ \
        !gcc/gcc/f/      !gcc/libf2c/ \
        !gcc/gcc/java/   !gcc/boehm-gc/   !gcc/libffi/     !gcc/libjava/ \
                         !gcc/zlib/       !gcc/fastjar/ \
        !gcc/gcc/objc/   !gcc/libobjc/ \
        gcc

This will have the behavior which I believe was intended by the modules
file writer.

> Inspecting the source code, I believe the problem is in ignore_directory
> in ignore.c.  There is a line which calls strncmp passing in strlen() as
> the number of characters to compare.  However, since strlen does not
> include the terminating null character, this means !gcc/f will match
> gcc/f*.

Hmmm... the intent of the code is to allow

     !gcc/f

to match gcc/f/anything-at-all.c whereas your suggested change does not
have that behavior. The exclusion is not actually looking at the
pathnames as if they were directories, but instead as initial
substrings. As such, terminating the substring with a '\0' character is
not desirable.

> I possible solution is attached.  I have not tested this patch, as I
> don't have a cvs server/repository I can use for testing patches.  The
> patch is relative to cvs-1.12.9.

Thank you for the suggested patch, but it is not really correct in this
case.

> Alternatively this could be fixed by documenting this behaviour as
> correct.

A suggested patch to the documentation would be welcome if you think the
ambiguity needs to be resolved.

        Enjoy!
        -- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFBJuLl3x41pRYZE/gRAsjtAJ0WJXiYla1JhOJKQbHYYtEoMj5urgCguWS7
m3wg/0eXojFcfMOsAjj8Sh0=
=3tVS
-----END PGP SIGNATURE-----




reply via email to

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