Skip to content

Commit 832ac79

Browse files
drafnelgitster
authored andcommitted
t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression
Regular expressions matched by 'expr' have an implicit '^' at the beginning of them and so are anchored to the beginning of the string. Using the '^' character to mean "match at the beginning", is redundant and could produce the wrong result if 'expr' implementations interpret the '^' as a literal '^'. Additionally, GNU expr 5.97 complains like this: expr: warning: unportable BRE: `^[a-z][a-z]*$': using `^' as the first character of the basic regular expression is not portable; it is being ignored Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0af88c1 commit 832ac79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/lib-pager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test_expect_success 'determine default pager' '
99
test -n "$less"
1010
'
1111

12-
if expr "$less" : '^[a-z][a-z]*$' >/dev/null
12+
if expr "$less" : '[a-z][a-z]*$' >/dev/null
1313
then
1414
test_set_prereq SIMPLEPAGER
1515
fi

0 commit comments

Comments
 (0)