diff options
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | 2006-08-10 17:02:30 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-10 14:13:53 -0700 |
commit | 83a2b841d6b90e6f4b797df40ed3a105364574b6 (patch) | |
tree | 06b21e14a70cde595570d2b7948245b26995dbb8 /refs.c | |
parent | 242abf106c6929028c2dc916504879885cd64d4d (diff) | |
download | git-83a2b841d6b90e6f4b797df40ed3a105364574b6.tar.gz |
Add has_extension()
The little helper has_extension() documents through its name what we are
trying to do and makes sure we don't forget the underrun check.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -147,7 +147,7 @@ static int do_for_each_ref(const char *base, int (*fn)(const char *path, const u namelen = strlen(de->d_name); if (namelen > 255) continue; - if (namelen>5 && !strcmp(de->d_name+namelen-5,".lock")) + if (has_extension(de->d_name, namelen, ".lock")) continue; memcpy(path + baselen, de->d_name, namelen+1); if (stat(git_path("%s", path), &st) < 0) |