Skip to content

Commit

Permalink
YETUS-789. bugsystem_linecomments_trigger breaks if prevnum or linenu…
Browse files Browse the repository at this point in the history
…m isn't numeric

Signed-off-by: Sean Busbey <busbey@apache.org>
  • Loading branch information
aw-was-here committed Feb 2, 2019
1 parent aa16845 commit bf88009
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions precommit/src/main/shell/test-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2396,6 +2396,16 @@ function bugsystem_linecomments_trigger

text=$(echo "${line}" | cut -f3- -d:)

# if, for some reason either one of these
# isn't a number, force it to be zero.
if [[ ! ${prevnum} =~ ^[0-9]+$ ]]; then
prevnum=0
fi

if [[ ! ${linenum} =~ ^[0-9]+$ ]]; then
linenum=0
fi

if [[ "${prevfn}" == "${fn}" ]] &&
[[ ${prevnum} -eq ${linenum} ]]; then
linetext+=("${text}")
Expand Down

0 comments on commit bf88009

Please sign in to comment.