diff options
author | Linus Torvalds | 2020-07-26 13:46:57 -0700 |
---|---|---|
committer | Linus Torvalds | 2020-07-26 13:46:57 -0700 |
commit | 1c8594b8427290c178c5d39885eacd9e41f68743 (patch) | |
tree | d56de40028d9ecdbebfc2121fd1ce1213fa09fa2 /scripts | |
parent | 40c60ac32174f0c0c090cd31d0d1712f2478e689 (diff) | |
parent | ca9b31f6bb9c6aa9b4e5f0792f39a97bbffb8c51 (diff) |
Merge tag 'kbuild-fixes-v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild into master
Pull Kbuild fixes from Masahiro Yamada:
- do not use non-portable strsep() in a host program
- fix single target builds for external modules
- change Clang's --prefix option to make it work for the latest Clang
* tag 'kbuild-fixes-v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation
kbuild: fix single target builds for external modules
modpost: remove use of non-standard strsep() in HOSTCC code
Diffstat (limited to 'scripts')
-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 */ |