Pull fluff into release branch
[sfrench/cifs-2.6.git] / scripts / kconfig / util.c
index 656d2c87d6614f13c9a23fc861cce0f356aba25e..e1cad924c0a41ab6fa1e8f917c0c01198419b549 100644 (file)
@@ -44,7 +44,9 @@ int file_write_dep(const char *name)
                else
                        fprintf(out, "\t%s\n", file->name);
        }
-       fprintf(out, "\n.config include/linux/autoconf.h: $(deps_config)\n\n$(deps_config):\n");
+       fprintf(out, "\ninclude/config/auto.conf: \\\n"
+                    "\t$(deps_config)\n\n"
+                    "$(deps_config): ;\n");
        fclose(out);
        rename("..config.tmp", name);
        return 0;
@@ -82,12 +84,15 @@ void str_free(struct gstr *gs)
 /* Append to growable string */
 void str_append(struct gstr *gs, const char *s)
 {
-       size_t l = strlen(gs->s) + strlen(s) + 1;
-       if (l > gs->len) {
-               gs->s   = realloc(gs->s, l);
-               gs->len = l;
+       size_t l;
+       if (s) {
+               l = strlen(gs->s) + strlen(s) + 1;
+               if (l > gs->len) {
+                       gs->s   = realloc(gs->s, l);
+                       gs->len = l;
+               }
+               strcat(gs->s, s);
        }
-       strcat(gs->s, s);
 }
 
 /* Append printf formatted string to growable string */