diff options
author | Junio C Hamano <junkio@cox.net> | 2006-08-12 18:34:36 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-12 18:35:14 -0700 |
commit | eed94a570e0421175d6b4342c0ac48e03ceedf0b (patch) | |
tree | f33864f2abffdcb83cbf626b26da34f9cc8d5bab /git-compat-util.h | |
parent | 4147d801db66df9b127ffe315601f467aa9d1c48 (diff) | |
parent | 01aaf1f88ddc2b99162c302710339f202996f39b (diff) | |
download | git-eed94a570e0421175d6b4342c0ac48e03ceedf0b.tar.gz |
Merge branch 'master' into js/c-merge-recursive
Adjust to hold_lock_file_for_update() change on the master.
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 93f558056d..b2e18954c0 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -91,6 +91,9 @@ static inline void *xmalloc(size_t size) ret = malloc(1); if (!ret) die("Out of memory, malloc failed"); +#ifdef XMALLOC_POISON + memset(ret, 0xA5, size); +#endif return ret; } @@ -136,6 +139,13 @@ static inline ssize_t xwrite(int fd, const void *buf, size_t len) } } +static inline int has_extension(const char *filename, const char *ext) +{ + size_t len = strlen(filename); + size_t extlen = strlen(ext); + return len > extlen && !memcmp(filename + len - extlen, ext, extlen); +} + /* Sane ctype - no locale, and works with signed chars */ #undef isspace #undef isdigit |