diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-08-03 09:37:31 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-08-03 09:37:31 -0300 |
commit | b1aa3db2c13ec0c63a73bd8fc5dfbfb112e3ff56 (patch) | |
tree | 92ce9158daae144032cc6297ab8fdbad12664247 /scripts/mod/modpost.c | |
parent | 7c43b0c1d499c790cdb5623d27fdcef544ddb566 (diff) | |
parent | bcf876870b95592b52519ed4aafcf9d95999bc9c (diff) |
Merge remote-tracking branch 'torvalds/master' into perf/core
Minor conflict in tools/perf/arch/arm/util/auxtrace.c as one fix there
was cherry-picked for the last perf/urgent pull req to Linus, so was
already there.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r-- | scripts/mod/modpost.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 6aea65c65745..69341b36f271 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -138,11 +138,20 @@ char *read_text_file(const char *filename) char *get_line(char **stringp) { + char *orig = *stringp, *next; + /* do not return the unwanted extra line at EOF */ - if (*stringp && **stringp == '\0') + if (!orig || *orig == '\0') return NULL; - return strsep(stringp, "\n"); + /* don't use strsep here, it is not available everywhere */ + next = strchr(orig, '\n'); + if (next) + *next++ = '\0'; + + *stringp = next; + + return orig; } /* A list of all modules we processed */ |