From 00f66f0e4913110e19972a71a150a7b9d1bfd02f Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 21 Dec 2010 18:50:47 +0000 Subject: t3419-*.sh: Fix arithmetic expansion syntax error Some shells, for example dash versions older than 0.5.4, need to spell a variable reference as '$N' rather than 'N' in an arithmetic expansion. In order to avoid the syntax error, we change the offending variable reference from 'i' to '$i' in function scramble. There is nothing bash specific to this test script (and we shouldn't have any bash dependent test). Fix its shebang line. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- t/t3419-rebase-patch-id.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh index 1aee483510..bd8efaf005 100755 --- a/t/t3419-rebase-patch-id.sh +++ b/t/t3419-rebase-patch-id.sh @@ -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" } -- cgit v1.2.3 From 77e572653b5089c9e3639fe4088f59e4cfef4eea Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 21 Dec 2010 14:27:55 -0600 Subject: t0050: fix printf format strings for portability Unlike bash and ksh, dash passes through hexadecimal \xcc escapes. So when run with dash, these tests *pass* (since '\xcc' is a perfectly reasonable filename) but they are not testing what was intended. Use octal escapes instead, in the spirit of v1.6.1-rc1~55^2 (2008-11-09). Reported-by: Ramsay Jones Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t0050-filesystem.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh index 41df6bcf27..07357ee1fc 100755 --- a/t/t0050-filesystem.sh +++ b/t/t0050-filesystem.sh @@ -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= -- cgit v1.2.3