summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-07-17 10:27:03 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-07-17 10:27:03 (EDT)
commit89d79227a5633eb1fcfe12e2a2edbb54611f5e38 (patch)
tree19d591ec131e16865d960db2d964b5757cc82d70 /src
parentc197a34e253b414349a8b75b7944923e02f3e893 (diff)
ppt-make: Do basic validation on platform names
Diffstat (limited to 'src')
-rw-r--r--src/ppt-make10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ppt-make b/src/ppt-make
index eb9a475..63e03f6 100644
--- a/src/ppt-make
+++ b/src/ppt-make
@@ -11,7 +11,15 @@ main()
{
local date=
- prompt 'Platform' PLATFORM
+ while [ "x${PLATFORM}" = 'x' ]; do
+ prompt 'Platform' PLATFORM
+ if [ "x${PLATFORM#*[^a-z0-9-]}" != "x${PLATFORM}" ]; then
+ printf 'Error: Platform name may consist only of %s\n' \
+ 'lowercase Latin letters, digits, and hypens' \
+ >&2
+ PLATFORM=''
+ fi
+ done
prompt 'Maintainer name' MAINTAINER_NAME
prompt 'Maintainer e-mail address' MAINTAINER_MAILBOX