Skip to content

Commit d30db56

Browse files
jaysoffiangitster
authored andcommitted
merge-one-file: fix "expr: non-numeric argument"
When invoking expr to compare two numbers, don't quote the variables which are the output of 'wc -c'. On OS X, this output includes spaces, which expr balks at: $ sz0=`wc -c </etc/passwd` $ sz1=`wc -c </etc/passwd` $ echo "'$sz0'" ' 3667' $ expr "$sz0" \< "$sz1" \* 2 expr: non-numeric argument $ expr $sz0 \< $sz1 \* 2 1 Signed-off-by: Jay Soffian <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e923eae commit d30db56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-merge-one-file.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ case "${1:-.}${2:-.}${3:-.}" in
112112

113113
# If we do not have enough common material, it is not
114114
# worth trying two-file merge using common subsections.
115-
expr "$sz0" \< "$sz1" \* 2 >/dev/null || : >$orig
115+
expr $sz0 \< $sz1 \* 2 >/dev/null || : >$orig
116116
;;
117117
*)
118118
echo "Auto-merging $4"

0 commit comments

Comments
 (0)