summaryrefslogtreecommitdiff
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-08-02 01:02:12 -0700
committerDavid S. Miller <davem@davemloft.net>2020-08-02 01:02:12 -0700
commitbd0b33b24897ba9ddad221e8ac5b6f0e38a2e004 (patch)
tree3f03062a9e759dba7b09df0feccbb58b8f7ab4cc /scripts/mod/modpost.c
parent7126bd5c8bcbc015cf89864cf71d750e8f33f924 (diff)
parentac3a0c8472969a03c0496ae774b3a29eb26c8d5a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Resolved kernel/bpf/btf.c using instructions from merge commit 69138b34a7248d2396ab85c8652e20c0c39beaba Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'scripts/mod/modpost.c')
-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 */