From b3aa58d2e85d5253a35a81320ae4d63ba6a482f0 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Mon, 16 Apr 2018 15:07:57 -0400 Subject: 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 Signed-off-by: Masahiro Yamada --- scripts/basic/fixdep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/basic') diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index f387538c58bc..850966f3d602 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -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"); } -- cgit v1.2.1