Skip to content

Commit a78f70e

Browse files
author
Michal Marek
committed
genksyms: Handle string literals with spaces in reference files
The reference files use spaces to separate tokens, however, we must preserve spaces inside string literals. Currently the only case in the tree is struct edac_raw_error_desc in <linux/edac.h>: $ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes $ mv drivers/edac/amd64_edac.{symtypes,symref} $ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes drivers/edac/amd64_edac.c:527: warning: amd64_get_dram_hole_info: modversion changed because of changes in struct edac_raw_error_desc Signed-off-by: Michal Marek <mmarek@suse.com>
1 parent 4c835b5 commit a78f70e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎scripts/genksyms/genksyms.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,15 @@ static struct string_list *read_node(FILE *f)
423423
struct string_list node = {
424424
.string = buffer,
425425
.tag = SYM_NORMAL };
426-
int c;
426+
int c, in_string = 0;
427427

428428
while ((c = fgetc(f)) != EOF) {
429-
if (c == ' ') {
429+
if (!in_string && c == ' ') {
430430
if (node.string == buffer)
431431
continue;
432432
break;
433+
} else if (c == '"') {
434+
in_string = !in_string;
433435
} else if (c == '\n') {
434436
if (node.string == buffer)
435437
return NULL;

0 commit comments

Comments
 (0)