fixdep: suppress consecutive / from file paths in dependency list files
authorNicolas Pitre <nicolas.pitre@linaro.org>
Mon, 16 Apr 2018 19:07:57 +0000 (15:07 -0400)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 7 May 2018 12:40:39 +0000 (21:40 +0900)
Underscores in symbol names are translated into slashes for path names.
Filesystems treat consecutive slashes as if there was only one, so
let's do the same in the dependency list for easier grepping, etc.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/basic/fixdep.c

index f387538c58bcb9a79d3bfd476527c3c16fe69c00..850966f3d6021bc1fb17472250ac7cf40bd42d0f 100644 (file)
@@ -115,7 +115,7 @@ static void usage(void)
  */
 static void print_dep(const char *m, int slen, const char *dir)
 {
-       int c, i;
+       int c, prev_c = '/', i;
 
        printf("    $(wildcard %s/", dir);
        for (i = 0; i < slen; i++) {
@@ -124,7 +124,9 @@ static void print_dep(const char *m, int slen, const char *dir)
                        c = '/';
                else
                        c = tolower(c);
-               putchar(c);
+               if (c != '/' || prev_c != '/')
+                       putchar(c);
+               prev_c = c;
        }
        printf(".h) \\\n");
 }