tweaks: rename a parameter and a variable, to be more distinct
parent
35a791dee5
commit
65560a583c
18
src/utils.c
18
src/utils.c
|
@ -495,19 +495,19 @@ void get_range(const linestruct **top, const linestruct **bot)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Given a line number, return a pointer to the corresponding struct. */
|
/* Return a pointer to the line that has the given line number. */
|
||||||
linestruct *line_from_number(ssize_t lineno)
|
linestruct *line_from_number(ssize_t number)
|
||||||
{
|
{
|
||||||
linestruct *f = openfile->current;
|
linestruct *line = openfile->current;
|
||||||
|
|
||||||
if (lineno <= openfile->current->lineno)
|
if (line->lineno > number)
|
||||||
while (f->lineno != lineno)
|
while (line->lineno != number)
|
||||||
f = f->prev;
|
line = line->prev;
|
||||||
else
|
else
|
||||||
while (f->lineno != lineno)
|
while (line->lineno != number)
|
||||||
f = f->next;
|
line = line->next;
|
||||||
|
|
||||||
return f;
|
return line;
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue