Skip to content

Commit 5d9a16b

Browse files
rkrejcimasahir0y
authored andcommitted
modpost: trim leading spaces when processing source files list
get_line() does not trim the leading spaces, but the parse_source_files() expects to get lines with source files paths where the first space occurs after the file path. Fixes: 70f30cf ("modpost: use read_text_file() and get_line() for reading text files") Signed-off-by: Radek Krejci <radek.krejci@oracle.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent dae4a01 commit 5d9a16b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/mod/sumversion.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
326326

327327
/* Sum all files in the same dir or subdirs. */
328328
while ((line = get_line(&pos))) {
329-
char* p = line;
329+
char* p;
330+
331+
/* trim the leading spaces away */
332+
while (isspace(*line))
333+
line++;
334+
p = line;
330335

331336
if (strncmp(line, "source_", sizeof("source_")-1) == 0) {
332337
p = strrchr(line, ' ');

0 commit comments

Comments
 (0)