Skip to content

Commit f52fd89

Browse files
committed
Revert "fix(createdb): use case instead of expr for portability"
This reverts commit 9f1eb5d.
1 parent 9f1eb5d commit f52fd89

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/createdb.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ set_dbuserpass () {
5050
}
5151

5252
add_granthost () {
53-
case "$1" in
54-
""|*[!a-zA-Z0-9.*%_]*)
53+
if expr "x$1" : 'x[-a-zA-Z0-9.*%_][-a-zA-Z0-9.*%_]*$' >/dev/null; then
54+
granthosts="$granthosts $1"
55+
else
5556
echo "Expected --grant-host=HOSTNAME" 1>&2
56-
usage;;
57-
*)
58-
granthosts="$granthosts $1";;
59-
esac
57+
usage
58+
fi
6059
}
6160

6261
PROG=$0

0 commit comments

Comments
 (0)