commit 27eef79198f2fed4f2881f4f8d4264c1ddfabae0
Author:     Quentin Rameau <[email protected]>
AuthorDate: Mon Jan 23 14:58:26 2017 +0100
Commit:     Quentin Rameau <[email protected]>
CommitDate: Mon Jan 23 14:59:34 2017 +0100

    [driver] move env parameters settings to main

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index da1a441..3baec99 100644
--- 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':

Reply via email to