tweaks: rename a parameter and a variable, to be more distinct

master
Benno Schulenberg 2019-05-24 19:27:04 +02:00
parent 35a791dee5
commit 65560a583c
1 changed files with 9 additions and 9 deletions

View File

@ -495,19 +495,19 @@ void get_range(const linestruct **top, const linestruct **bot)
}
}
/* Given a line number, return a pointer to the corresponding struct. */
linestruct *line_from_number(ssize_t lineno)
/* Return a pointer to the line that has the given line number. */
linestruct *line_from_number(ssize_t number)
{
linestruct *f = openfile->current;
linestruct *line = openfile->current;
if (lineno <= openfile->current->lineno)
while (f->lineno != lineno)
f = f->prev;
if (line->lineno > number)
while (line->lineno != number)
line = line->prev;
else
while (f->lineno != lineno)
f = f->next;
while (line->lineno != number)
line = line->next;
return f;
return line;
}
#endif /* !NANO_TINY */