OSDN Git Service
(root)
/
git-core
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3def06e
)
apply.c::find_name_traditional(): do not initialize len to the line's length
author
Stefan Beller
<stefanbeller@googlemail.com>
Thu, 18 Jul 2013 21:35:27 +0000
(23:35 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 19 Jul 2013 18:15:17 +0000
(11:15 -0700)
The variable len is set to
len = strchrnul(line, '\n') - line;
unconditionally 9 lines later, hence we can remove the call to strlen.
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c
patch
|
blob
|
history
diff --git
a/builtin/apply.c
b/builtin/apply.c
index
0e9b631
..
ff01ebf
100644
(file)
--- a/
builtin/apply.c
+++ b/
builtin/apply.c
@@
-722,7
+722,7
@@
static char *find_name(const char *line, char *def, int p_value, int terminate)
static char *find_name_traditional(const char *line, char *def, int p_value)
{
- size_t len
= strlen(line)
;
+ size_t len;
size_t date_len;
if (*line == '"') {