Skip to content

Commit b3aa58d

Browse files
Nicolas Pitremasahir0y
authored andcommitted
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. Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 75bc37f commit b3aa58d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎scripts/basic/fixdep.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static void usage(void)
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)
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
}

0 commit comments

Comments
 (0)