History

fixdep: suppress consecutive / from file paths in dependency list files

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.

Nicolas Pitre committed 8 years ago

Commit b3aa58d1 parent 75bc37f1 file · +4 −2Browse files

Showing the changes to scripts/basic (1 of 1 file). Show all

Unified · Split

scripts/basic/fixdep.c+4−2
@@ -115,7 +115,7 @@ static void usage(void) · 114 unmodified lines
115115 */
116116 static void print_dep(const char *m, int slen, const char *dir)
117117 {
118− int c, i;
118+ int c, prev_c = '/', i;
119119
120120 printf(" $(wildcard %s/", dir);
121121 for (i = 0; i < slen; i++) {
@@ -124,7 +124,9 @@ static void print_dep(const char *m, int slen, const char *dir) · 2 unmodified lines
124124 c = '/';
125125 else
126126 c = tolower(c);
127− putchar(c);
127+ if (c != '/' || prev_c != '/')
128+ putchar(c);
129+ prev_c = c;
128130 }
129131 printf(".h) \\\n");
130132 }