Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/dumb-http-idx-fetch-fix' into maint
[gitweb.git]
/
git-compat-util.h
diff --git
a/git-compat-util.h
b/git-compat-util.h
index eb9b0ff32829ef62bf2d1af432742841b9720906..553fc017623be771878778c84aca08a4684f6902 100644
(file)
--- a/
git-compat-util.h
+++ b/
git-compat-util.h
@@
-678,6
+678,11
@@
extern char *xgetcwd(void);
#define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), (alloc) * sizeof(*(x)))
+static inline char *xstrdup_or_null(const char *str)
+{
+ return str ? xstrdup(str) : NULL;
+}
+
static inline size_t xsize_t(off_t len)
{
if (len > (size_t) len)