summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorschu <schu-github@schulog.org>2011-06-09 18:11:11 +0200
committerschu <schu-github@schulog.org>2011-07-06 12:25:27 +0200
commite190da78f373511ca999d32f66115bbc75705abf (patch)
tree8cb062aef265f7d36c2d854e2a89e97268d2484f /src/fileops.c
parenta6e0f315f5f82babd669d93705059c24a6772084 (diff)
downloadlibgit2-e190da78f373511ca999d32f66115bbc75705abf.tar.gz
fileops: add convenience function is_dot_or_dotdot()
Signed-off-by: schu <schu-github@schulog.org>
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 52aeb41a3..edde3aa46 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -231,13 +231,8 @@ int git_futils_direach(
size_t de_len;
int result;
- /* always skip '.' and '..' */
- if (de->d_name[0] == '.') {
- if (de->d_name[1] == '\0')
- continue;
- if (de->d_name[1] == '.' && de->d_name[2] == '\0')
- continue;
- }
+ if (is_dot_or_dotdot(de->d_name))
+ continue;
de_len = strlen(de->d_name);
if (path_sz < wd_len + de_len + 1) {