scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 27eef79198f2fed4f2881f4f8d4264c1ddfabae0
parent b34aa2c27fb0724d6bd2ffda631feaa503122ed4
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon, 23 Jan 2017 14:58:26 +0100

[driver] move env parameters settings to main

Diffstat:
Mdriver/posix/scc.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/driver/posix/scc.c b/driver/posix/scc.c @@ -103,14 +103,10 @@ inittool(int tool) switch (tool) { case CC1: /* FALLTHROUGH */ case CC2: - if (!arch) - arch = ARCH; n = snprintf(t->bin, sizeof(t->bin), "%s-%s", t->cmd, arch); if (n < 0 || n >= sizeof(t->bin)) die("scc: target tool name too long"); - if (!execpath) - execpath = PREFIX "/libexec/scc"; n = snprintf(t->cmd, sizeof(t->cmd), "%s/%s", execpath, t->bin); if (n < 0 || n >= sizeof(t->cmd)) die("scc: target tool path too long"); @@ -421,8 +417,10 @@ main(int argc, char *argv[]) atexit(terminate); - arch = getenv("ARCH"); - execpath = getenv("SCCEXECPATH"); + if (!(arch = getenv("ARCH"))) + arch = ARCH; + if (!(execpath = getenv("SCCEXECPATH"))) + execpath = PREFIX "/libexec/scc"; ARGBEGIN { case 'D':