[PATCH] Fix off by one error in prep_exclude.
- From
Shawn Bohrer <shawn.bohrer@gmail.com>
- Date
- Jan 27, 2008, 19:55 UTC
- Message-ID
- <1201463731-1963-1-git-send-email-shawn.bohrer@gmail.com>
- In-Reply-To
- <47975FE6.4050709@viscovery.net>
base + current already includes the trailing slash so adding one removes the first character of the next directory.
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> ---
This fixes the oops part of the issue Johannes found, but doesn't address the fact that we probably should remove files that aren't a part of the repository at in the first place.
dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dir.c b/dir.c index 3e345c2..9e5879a 100644 --- a/dir.c +++ b/dir.c @@ -237,7 +237,7 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen) current = 0; } else { - cp = strchr(base + current + 1, '/'); + cp = strchr(base + current, '/'); if (!cp) die("oops in prep_exclude"); cp++;
-- 1.5.4-rc2.GIT