[hackers] [scc] [driver] move env parameters settings to main || Quentin Rameau

From: <git_AT_suckless.org>
Date: Mon, 23 Jan 2017 15:26:20 +0100 (CET)

commit 27eef79198f2fed4f2881f4f8d4264c1ddfabae0
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Mon Jan 23 14:58:26 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
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
_AT_@ -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");
_AT_@ -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':
Received on Mon Jan 23 2017 - 15:26:20 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 23 2017 - 15:36:24 CET