scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit d0b5bbca0d530653369c8cc94214fe44cc2bfad1
parent c7b52bd47910e2c14bc19422d14c432d20d92cce
Author: Evan Gates <evan.gates@gmail.com>
Date:   Thu, 16 Jul 2015 11:55:03 -0700

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 <evan.gates@gmail.com>
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

Diffstat:
build.sh | 5++---
env.sh | 8++++----
kcc | 5++---
3 files changed, 8 insertions(+), 10 deletions(-)

diff --git 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 @@ -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 @@ -1,6 +1,5 @@ #!/bin/sh -PATH=$PWD/cc1:$PWD/cc2 - -cc1 < $1 | cc2 +PATH="$PWD/cc1:$PWD/cc2" +cc1 < "$1" | cc2