startup: allow negative line and column numbers on the command line
They can be given at the prompt, so it's better to accept them on the command line too.master
parent
a71a2f9a0c
commit
8b80ec3e1a
|
@ -2551,7 +2551,7 @@ int main(int argc, char **argv)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* If a position was given on the command line, go there. */
|
/* If a position was given on the command line, go there. */
|
||||||
if (givenline > 0 || givencol > 0)
|
if (givenline != 0 || givencol != 0)
|
||||||
do_gotolinecolumn(givenline, givencol, FALSE, FALSE);
|
do_gotolinecolumn(givenline, givencol, FALSE, FALSE);
|
||||||
#ifndef DISABLE_HISTORIES
|
#ifndef DISABLE_HISTORIES
|
||||||
else if (ISSET(POS_HISTORY)) {
|
else if (ISSET(POS_HISTORY)) {
|
||||||
|
|
|
@ -859,10 +859,10 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (line < 1)
|
if (line == 0)
|
||||||
line = openfile->current->lineno;
|
line = openfile->current->lineno;
|
||||||
|
|
||||||
if (column < 1)
|
if (column == 0)
|
||||||
column = openfile->placewewant + 1;
|
column = openfile->placewewant + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue