summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-07 21:48:11 -0500
committerJune McEnroe <june@causal.agency>2020-12-07 21:48:11 -0500
commitc558cad1adac85a12dde1dd63aedeacfb333457e (patch)
tree3903dec64fb77294e3d4329df2f9e13d1aac34b6 /bin
parentAdd I Feel It All (diff)
downloadsrc-c558cad1adac85a12dde1dd63aedeacfb333457e.tar.gz
src-c558cad1adac85a12dde1dd63aedeacfb333457e.zip
Clean up variable expansions in c.sh
Diffstat (limited to 'bin')
-rw-r--r--bin/c.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/c.sh b/bin/c.sh
index 6d2b6b35..f1143fd3 100644
--- a/bin/c.sh
+++ b/bin/c.sh
@@ -2,7 +2,7 @@
 set -eu
 
 temp=$(mktemp -d)
-trap 'rm -r "$temp"' EXIT
+trap 'rm -r "${temp}"' EXIT
 
 exec 3>>"${temp}/run.c"
 
@@ -28,8 +28,9 @@ cat >&3 <<EOF
 #include <unistd.h>
 EOF
 
+expr=
 while getopts 'e:i:' opt; do
-	case "$opt" in
+	case "${opt}" in
 		(e) expr=$OPTARG;;
 		(i) echo "#include <${OPTARG}>" >&3;;
 		(?) exit 1;;
@@ -44,7 +45,7 @@ int main(int argc, char *argv[]) {
 	$*;
 EOF
 
-if [ -n "${expr:-}" ]; then
+if [ -n "${expr}" ]; then
 	cat >&3 <<EOF
 	printf(
 		_Generic(
@@ -72,7 +73,7 @@ if [ -n "${expr:-}" ]; then
 EOF
 fi
 
-if [ $# -eq 0 -a -z "${expr:-}" ]; then
+if [ $# -eq 0 -a -z "${expr}" ]; then
 	cat >&3
 fi
 
after movementJune McEnroe 2017-09-03Relicense AGPLJune McEnroe I know it's already published under a permissive license in what is probably its final form, but I want to license it AGPL anyway on principle following some conversations I had about open source, corporations and copyleft. 2017-09-01Revert "Add client readOnly mode"June McEnroe This reverts commit 34f25ae40a3db9369e9d98b3814f2b93bbc21451. 2017-09-01Remove clientRemove call from clientCastJune McEnroe If an error occurs on a client socket during a broadcast, that client will show up in the kqueue loop with EV_EOF and get removed that way. Tested by sending SIGKILL to a client and watching its cursor disappear. 2017-09-01Add client readOnly modeJune McEnroe 2017-08-31Clean up merge toolJune McEnroe Choose the version with the most recent access if the modify times are the same. 2017-08-31Choose B for tiles with equal modify timesJune McEnroe This way newer access counts and times will be preserved. 2017-08-31Add quick data file merge toolJune McEnroe Hopefully I won't have to use it ever again. 2017-08-30Use only foreground color for selecting spawnJune McEnroe 2017-08-29Add four additional spawnsJune McEnroe 2017-08-28Add respawningJune McEnroe 2017-08-26Move license above includesJune McEnroe Why was it down there? 2017-08-26Snapshot metadataJune McEnroe 2017-08-26Add meta.c to READMEJune McEnroe 2017-08-26Use MakefileJune McEnroe