diff options
| author | schu <schu-github@schulog.org> | 2011-06-09 18:11:11 +0200 |
|---|---|---|
| committer | schu <schu-github@schulog.org> | 2011-07-06 12:25:27 +0200 |
| commit | e190da78f373511ca999d32f66115bbc75705abf (patch) | |
| tree | 8cb062aef265f7d36c2d854e2a89e97268d2484f /src/fileops.h | |
| parent | a6e0f315f5f82babd669d93705059c24a6772084 (diff) | |
| download | libgit2-e190da78f373511ca999d32f66115bbc75705abf.tar.gz | |
fileops: add convenience function is_dot_or_dotdot()
Signed-off-by: schu <schu-github@schulog.org>
Diffstat (limited to 'src/fileops.h')
| -rw-r--r-- | src/fileops.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fileops.h b/src/fileops.h index 4bfebe9d4..cc88682ac 100644 --- a/src/fileops.h +++ b/src/fileops.h @@ -102,6 +102,14 @@ extern int git_futils_mv_withpath(const char *from, const char *to); */ extern git_off_t git_futils_filesize(git_file fd); +/* Taken from git.git */ +static inline int is_dot_or_dotdot(const char *name) +{ + return (name[0] == '.' && + (name[1] == '\0' || + (name[1] == '.' && name[2] == '\0'))); +} + /** * Read-only map all or part of a file into memory. * When possible this function should favor a virtual memory |
