diff options
author | 2020-08-11 11:58:31 +1000 | |
---|---|---|
committer | 2020-08-11 11:58:31 +1000 | |
commit | c44264f9f729fd63bd6a81a6ac5cd6cd49af09e5 (patch) | |
tree | ad77b18ffeafb50b3eb9ba6472670dc1d96f5558 /scripts/mod | |
parent | Merge tag 'drm-misc-next-fixes-2020-08-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-next (diff) | |
parent | Linux 5.8 (diff) | |
download | wireguard-linux-c44264f9f729fd63bd6a81a6ac5cd6cd49af09e5.tar.xz wireguard-linux-c44264f9f729fd63bd6a81a6ac5cd6cd49af09e5.zip |
Merge tag 'v5.8' into drm-next
I need to backmerge 5.8 as I've got a bunch of fixes sitting
on an rc7 base that I want to land.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'scripts/mod')
-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 */ |