]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don't crash when CCACHE_PREFIX is " "
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 3 Feb 2011 21:27:45 +0000 (22:27 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 3 Feb 2011 21:27:45 +0000 (22:27 +0100)
ccache.c

index 8ae0901da8ae5332526ffa7aee4c99d5820c9f75..60d37a70fa46b509e788dcf5903d313fb94896e2 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -212,7 +212,7 @@ add_prefix(struct args *orig_args)
        if (env && strlen(env) > 0) {
                char *e;
                char *tok, *saveptr = NULL;
-               struct args *prefix = NULL;
+               struct args *prefix = args_init(0, NULL);
                int i;
 
                e = x_strdup(env);
@@ -226,11 +226,7 @@ add_prefix(struct args *orig_args)
                                fatal("%s: %s", tok, strerror(errno));
                        }
 
-                       if (prefix) {
-                               args_add(prefix, p);
-                       } else {
-                               prefix = args_init_from_string(p);
-                       }
+                       args_add(prefix, p);
                }
                free(e);