My Various Git Projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c9b03b
)
attr.c: use strchrnul() to scan for one line
author
Junio C Hamano
<gitster@pobox.com>
Sat, 28 Jan 2017 02:01:42 +0000
(18:01 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 1 Feb 2017 21:46:51 +0000
(13:46 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c
patch
|
blob
|
history
diff --git
a/attr.c
b/attr.c
index
1fcf042
..
04d2433
100644
(file)
--- a/
attr.c
+++ b/
attr.c
@@
-402,8
+402,8
@@
static struct attr_stack *read_attr_from_index(const char *path, int macro_ok)
for (sp = buf; *sp; ) {
char *ep;
int more;
- for (ep = sp; *ep && *ep != '\n'; ep++)
-
;
+
+
ep = strchrnul(sp, '\n')
;
more = (*ep == '\n');
*ep = '\0';
handle_attr_line(res, sp, path, ++lineno, macro_ok);