summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ef5644e)
raw | patch | inline | side by side (parent: ef5644e)
author | Brandon Casey <drafnel@gmail.com> | |
Thu, 9 Sep 2010 19:02:46 +0000 (14:02 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 10 Sep 2010 00:18:29 +0000 (17:18 -0700) |
Generally, trailing space is removed from the string matched by the
xfuncname patterns. The exception is when the matched string exceeds the
length of the fixed-size buffer that it will be copied in to. But, a
string that exceeds the buffer can still contain trailing space in the
portion of the string that will be copied into the buffer. So, simplify
this code slightly, and just perform the trailing space removal always.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xfuncname patterns. The exception is when the matched string exceeds the
length of the fixed-size buffer that it will be copied in to. But, a
string that exceeds the buffer can still contain trailing space in the
portion of the string that will be copied into the buffer. So, simplify
this code slightly, and just perform the trailing space removal always.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff-interface.c | patch | blob | history |
diff --git a/xdiff-interface.c b/xdiff-interface.c
index cd2285de1cb1faa9f7c6c97dd22210f20bb046a3..e1e054e4d982de30d8a9c8c4109c6d62448f62a9 100644 (file)
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
result = pmatch[i].rm_eo - pmatch[i].rm_so;
if (result > buffer_size)
result = buffer_size;
- else
- while (result > 0 && (isspace(line[result - 1])))
- result--;
+ while (result > 0 && (isspace(line[result - 1])))
+ result--;
memcpy(buffer, line, result);
fail:
free(line_buffer);