Merge branch 'maint'

* maint:
  gitweb: use decode_utf8 directly
  posix compatibility for t4200
  Document 'opendiff' value in config.txt and git-mergetool.txt
  Allow PERL_PATH="/usr/bin/env perl"
  Make xstrndup common
  diff.c: fix "size cache" handling.
  http-fetch: Disable use of curl multi support for libcurl < 7.16.
This commit is contained in:
Junio C Hamano
2007-05-03 23:26:54 -07:00
9 changed files with 35 additions and 35 deletions

View File

@ -197,6 +197,19 @@ static inline void *xmalloc(size_t size)
return ret;
}
static inline char *xstrndup(const char *str, size_t len)
{
char *p;
p = memchr(str, '\0', len);
if (p)
len = p - str;
p = xmalloc(len + 1);
memcpy(p, str, len);
p[len] = '\0';
return p;
}
static inline void *xrealloc(void *ptr, size_t size)
{
void *ret = realloc(ptr, size);