prepare: restrict user input to digits in _prompt_from_array (#261)
Signed-off-by: Adel KARA SLIMANE <adel.ks@zegrapher.com>
This commit is contained in:
committed by
GitHub
parent
36af28fd6c
commit
c672fa3475
@@ -63,7 +63,7 @@ _prompt_from_array() {
|
||||
if [[ -z "$REPLY" && -n "$_default_index" ]]; then
|
||||
_selected_index="$_default_index"
|
||||
break
|
||||
elif [[ -n "$REPLY" && 0 -le "$REPLY" && "$REPLY" -le $_N ]]; then
|
||||
elif [[ "$REPLY" =~ ^[0-9]+$ && 0 -le "$REPLY" && "$REPLY" -le $_N ]]; then
|
||||
_selected_index="$REPLY"
|
||||
break
|
||||
else
|
||||
|
Reference in New Issue
Block a user