[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug of excluding directories
From: |
Larry Jones |
Subject: |
Re: Bug of excluding directories |
Date: |
Wed, 12 Mar 2003 14:02:00 -0500 (EST) |
Jie Zhang writes:
>
> Suppose directory first-dir contain two directories: d and d2. My
> modules file contains:
> exmodule -a !first-dir/d first-dir
> then checking out the module 'exmodule' will not check out both d and d2.
>
> I read the source code and found that we should use
> strcmp (name, dir_ign_list[i])
> instead of
> strncmp (name, dir_ign_list[i], strlen (dir_ign_list[i])
> in function ignore_directory(name) in file ignore.c.
>
> Is this a bug or an intended character of cvs?
I think it's a bug, but I don't think your change is correct, either. I
believe the intent is not to ignore d2 in addition to d, but to ignore
d/foo. So you'd want something like:
strncmp (name, dir_ign_list[i], strlen (dir_ign_list[i])) == 0 &&
(name [strlen (dir_ign_list[i])] == '\0' ||
ISDIRSEP (name [strlen (dir_ign_list[i])]))
-Larry Jones
I'm a genius. -- Calvin