Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-13 05:34:36 +0400
committerJunio C Hamano <junkio@cox.net>2006-08-13 05:35:14 +0400
commiteed94a570e0421175d6b4342c0ac48e03ceedf0b (patch)
treef33864f2abffdcb83cbf626b26da34f9cc8d5bab /git-compat-util.h
parent4147d801db66df9b127ffe315601f467aa9d1c48 (diff)
parent01aaf1f88ddc2b99162c302710339f202996f39b (diff)
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.h10
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