summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-07-26 22:46:57 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-07-26 22:46:57 +0200
commit1c8594b8427290c178c5d39885eacd9e41f68743 (patch)
treed56de40028d9ecdbebfc2121fd1ce1213fa09fa2 /scripts
parentMerge branch 'parisc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
parentMakefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation (diff)
downloadlinux-1c8594b8427290c178c5d39885eacd9e41f68743.tar.xz
linux-1c8594b8427290c178c5d39885eacd9e41f68743.zip
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.c12
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 */