From 89d79227a5633eb1fcfe12e2a2edbb54611f5e38 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 17 Jul 2014 10:27:03 -0400 Subject: ppt-make: Do basic validation on platform names --- 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 -- cgit v0.9.1