summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9932977)
raw | patch | inline | side by side (parent: 9932977)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Jun 2010 18:18:54 +0000 (11:18 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Jun 2010 18:18:54 +0000 (11:18 -0700) |
As Brandon noticed, a regular expression match given to 'expr' is already
anchored at the beginning. Some versions of expr even complain about this.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
anchored at the beginning. Some versions of expr even complain about this.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7005-editor.sh | patch | blob | history | |
t/t7006-pager.sh | patch | blob | history |
diff --git a/t/t7005-editor.sh b/t/t7005-editor.sh
index 5257f4d261c2060b881d2649034232f76f4ed9b7..6355698c6b5d133988270b5c5ded3b0209b1bf03 100755 (executable)
--- a/t/t7005-editor.sh
+++ b/t/t7005-editor.sh
'
-if ! expr "$vi" : '^[a-z]*$' >/dev/null
+if ! expr "$vi" : '[a-z]*$' >/dev/null
then
vi=
fi
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 3bc7a2a796bdb97702eaaf92e26b189cc4204c90..0f6b367832ed164a126abc6206e724a7a0e4feb0 100755 (executable)
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
# for the first color; the text "commit" comes later.
colorful() {
read firstline <$1
- ! expr "$firstline" : "^[a-zA-Z]" >/dev/null
+ ! expr "$firstline" : "[a-zA-Z]" >/dev/null
}
test_expect_success 'tests can detect color' '
test -n "$less"
'
-if expr "$less" : '^[a-z][a-z]*$' >/dev/null && test_have_prereq TTY
+if expr "$less" : '[a-z][a-z]*$' >/dev/null && test_have_prereq TTY
then
test_set_prereq SIMPLEPAGER
fi