commit 9d2db0a3e18ba554613c2531d18f93cc5c54086c
Author:     Quentin Rameau <[email protected]>
AuthorDate: Mon May 30 11:41:59 2016 +0200
Commit:     Quentin Rameau <[email protected]>
CommitDate: Mon May 30 11:41:59 2016 +0200

    [driver] switch per tool in settool
    
    We will need that later with the introduction of as and ld.

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index a5d8ef6..ad058da 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -57,7 +57,9 @@ settool(int tool, int pipeout)
        int fds[2], n;
        static int fdin;
 
-       if (tool != QBE) {
+       switch (tool) {
+       case CC1:
+       case CC2:
                n = snprintf(tools[tool].bin, sizeof(tools[tool].bin),
                             arch ? "%s-%s" : "%s", tools[tool].name, arch);
                if (n < 0 || n >= sizeof(tools[tool].bin))
@@ -67,6 +69,9 @@ settool(int tool, int pipeout)
                             "%s/libexec/scc/%s", PREFIX, tools[tool].bin);
                if (n < 0 || n >= sizeof(tools[tool].cmd))
                        die("scc: target tool path too long");
+               break;
+       default:
+               break;
        }
 
        tools[tool].args[0] = tools[tool].bin;

Reply via email to