Skip to content

Commit

Permalink
Tighten numeric regex
Browse files Browse the repository at this point in the history
  • Loading branch information
vr8ce committed Jun 20, 2020
1 parent 6ccd2fa commit 27f42be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/git-undo
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ EOL
;;
esac

if [[ ! $parm2 =~ [1-9]*([0-9]) ]]; then
if [[ ! $parm2 =~ ^[1-9][0-9]*$ ]]; then
echo "Invalid undo count: $parm2"
exit 1
fi
Expand Down

0 comments on commit 27f42be

Please sign in to comment.