summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec72220)
raw | patch | inline | side by side (parent: ec72220)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 22 Dec 2006 02:20:11 +0000 (03:20 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 22 Dec 2006 04:31:14 +0000 (20:31 -0800) |
When parsing the diff line starting with '@@', the line number of the
'+' file is parsed. For the subsequent line parses, the line number
should therefore be incremented after the parse, not before it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
'+' file is parsed. For the subsequent line parses, the line number
should therefore be incremented after the parse, not before it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history |
index 33153787b8117396cf906e69e656849ac04f3257..b003c00016995b2afbe3eb23c4e64f7e43761987 100644 (file)
--- a/diff.c
+++ b/diff.c
if (line[0] == '+') {
int i, spaces = 0;
- data->lineno++;
-
/* check space before tab */
for (i = 1; i < len && (line[i] == ' ' || line[i] == '\t'); i++)
if (line[i] == ' ')
if (isspace(line[len - 1]))
printf("%s:%d: white space at end: %.*s\n",
data->filename, data->lineno, (int)len, line);
+
+ data->lineno++;
} else if (line[0] == ' ')
data->lineno++;
else if (line[0] == '@') {