Merge branch 'master' into next

* master:
  t0050: fix printf format strings for portability
  t3419-*.sh: Fix arithmetic expansion syntax error
  set_try_to_free_routine(NULL) means "do nothing special"
This commit is contained in:
Junio C Hamano
2010-12-21 14:45:35 -08:00
4 changed files with 8 additions and 10 deletions

View File

@@ -4,8 +4,8 @@ test_description='Various filesystem issues'
. ./test-lib.sh
auml=`printf '\xc3\xa4'`
aumlcdiar=`printf '\x61\xcc\x88'`
auml=$(printf '\303\244')
aumlcdiar=$(printf '\141\314\210')
case_insensitive=
unibad=

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
test_description='git rebase - test patch id computation'
@@ -27,7 +27,7 @@ scramble()
then
echo "$x"
fi
i=$(((i+1) % 10))
i=$((($i+1) % 10))
done < "$1" > "$1.new"
mv -f "$1.new" "$1"
}

View File

@@ -25,10 +25,6 @@
#include "cache.h"
#include "quote.h"
static void do_nothing(size_t unused)
{
}
/* Get a trace file descriptor from GIT_TRACE env variable. */
static int get_trace_fd(int *need_close)
{
@@ -76,7 +72,7 @@ void trace_printf(const char *fmt, ...)
if (!fd)
return;
set_try_to_free_routine(do_nothing); /* is never reset */
set_try_to_free_routine(NULL); /* is never reset */
strbuf_init(&buf, 64);
va_start(ap, fmt);
len = vsnprintf(buf.buf, strbuf_avail(&buf), fmt, ap);
@@ -108,7 +104,7 @@ void trace_argv_printf(const char **argv, const char *fmt, ...)
if (!fd)
return;
set_try_to_free_routine(do_nothing); /* is never reset */
set_try_to_free_routine(NULL); /* is never reset */
strbuf_init(&buf, 64);
va_start(ap, fmt);
len = vsnprintf(buf.buf, strbuf_avail(&buf), fmt, ap);

View File

@@ -12,6 +12,8 @@ static void (*try_to_free_routine)(size_t size) = do_nothing;
try_to_free_t set_try_to_free_routine(try_to_free_t routine)
{
try_to_free_t old = try_to_free_routine;
if (!routine)
routine = do_nothing;
try_to_free_routine = routine;
return old;
}