commit d0b5bbca0d530653369c8cc94214fe44cc2bfad1
Author: Evan Gates <[email protected]>
AuthorDate: Thu Jul 16 11:55:03 2015 -0700
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Fri Jul 17 07:09:43 2015 +0200
sh style and syntax fixes
quote all substitutions
use $() instead of ``
use . instead of source
. needs a path with a / or it will search PATH instead
-emg
From bbaa9bede596f68851b17ddd80f42a72ec17745b Mon Sep 17 00:00:00 2001
From: Evan Gates <[email protected]>
Date: Thu, 16 Jul 2015 11:49:45 -0700
Subject: [PATCH] sh style and syntax fixes
quote all substitutions
use $() instead of ``
use . instead of source
. needs a path with a / or it will search PATH instead
diff --git a/build.sh b/build.sh
index dea6489..42e3ef8 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,4 @@
#!/bin/sh
-source env.sh
-make $@
-
+. ./env.sh
+make "$@"
diff --git a/env.sh b/env.sh
index 30f3b88..fa599ea 100755
--- a/env.sh
+++ b/env.sh
@@ -1,15 +1,15 @@
#!/bin/sh
-case `uname` in
+case "$(uname)" in
Plan9)
CFLAGS="-D_SUSV2_SOURCE -DNBOOL"
export CFLAGS
;;
*)
- case x$CC in
- xc99)
+ case "$CC" in
+ c99)
;;
- x|xgcc)
+ ''|gcc)
CC=gcc
CFLAGS=-std=c99
export CFLAGS CC
diff --git a/kcc b/kcc
index add6bc1..b996a20 100755
--- a/kcc
+++ b/kcc
@@ -1,6 +1,5 @@
#!/bin/sh
-PATH=$PWD/cc1:$PWD/cc2
-
-cc1 < $1 | cc2
+PATH="$PWD/cc1:$PWD/cc2"
+cc1 < "$1" | cc2