mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-30 08:33:17 +03:00
tweaks: drop an assert, add a warning, and change a 'for' to a 'while'
This commit is contained in:
parent
9936a6357a
commit
e4cef3086b
10
src/nano.c
10
src/nano.c
@ -179,15 +179,17 @@ void renumber(filestruct *line)
|
|||||||
{
|
{
|
||||||
ssize_t number;
|
ssize_t number;
|
||||||
|
|
||||||
if (line == NULL)
|
if (line == NULL) {
|
||||||
|
statusline(ALERT, "Trying to renumber nothing -- please report a bug");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
number = (line->prev == NULL) ? 0 : line->prev->lineno;
|
number = (line->prev == NULL) ? 0 : line->prev->lineno;
|
||||||
|
|
||||||
assert(line != line->next);
|
while (line != NULL) {
|
||||||
|
|
||||||
for (; line != NULL; line = line->next)
|
|
||||||
line->lineno = ++number;
|
line->lineno = ++number;
|
||||||
|
line = line->next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Partition the current buffer so that it appears to begin at (top, top_x)
|
/* Partition the current buffer so that it appears to begin at (top, top_x)
|
||||||
|
Loading…
Reference in New Issue
Block a user