diff options
author | 2020-07-28 13:18:01 +0200 | |
---|---|---|
committer | 2020-07-28 13:18:01 +0200 | |
commit | e89d4ca1df630378bde3e36c42001b755b0044fe (patch) | |
tree | d953ccecb8365acab65d0075e674f7e9a9bd9880 /scripts/mod | |
parent | x86/perf: Fix a typo (diff) | |
parent | Linux 5.8-rc7 (diff) | |
download | wireguard-linux-e89d4ca1df630378bde3e36c42001b755b0044fe.tar.xz wireguard-linux-e89d4ca1df630378bde3e36c42001b755b0044fe.zip |
Merge tag 'v5.8-rc7' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/modpost.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 6aea65c65745..45f2ab2ec2d4 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -138,11 +138,19 @@ 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"); + next = strchr(orig, '\n'); + if (next) + *next++ = '\0'; + + *stringp = next; + + return orig; } /* A list of all modules we processed */ |