summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 499019c)
raw | patch | inline | side by side (parent: 499019c)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 22 Jan 2009 16:00:45 +0000 (17:00 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 22 Jan 2009 16:06:13 +0000 (17:06 +0100) |
tig.c | patch | blob | history |
index 0e1028a7d709ffda3200e85b63c2d583785ebb5e..238033278f7bc89d3e40401ef02889d9fb4d3d6d 100644 (file)
--- a/tig.c
+++ b/tig.c
status_exists(struct status *status, enum line_type type)
{
struct view *view = VIEW(REQ_VIEW_STATUS);
- struct line *line;
+ unsigned long lineno;
- for (line = view->line; line < view->line + view->lines; line++) {
+ for (lineno = 0; lineno < view->lines; lineno++) {
+ struct line *line = &view->line[lineno];
struct status *pos = line->data;
if (line->type != type)
continue;
- if (!pos && (!status || !status->status))
+ if (!pos && (!status || !status->status) && line[1].data) {
+ select_view_line(view, lineno);
return TRUE;
- if (pos && !strcmp(status->new.name, pos->new.name))
+ }
+ if (pos && !strcmp(status->new.name, pos->new.name)) {
+ select_view_line(view, lineno);
return TRUE;
+ }
}
return FALSE;