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
Benno Schulenberg 2017-06-23 10:25:12 +02:00
parent a71a2f9a0c
commit 8b80ec3e1a
2 changed files with 3 additions and 3 deletions

View File

@ -2551,7 +2551,7 @@ int main(int argc, char **argv)
continue;
/* 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);
#ifndef DISABLE_HISTORIES
else if (ISSET(POS_HISTORY)) {

View File

@ -859,10 +859,10 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
return;
}
} else {
if (line < 1)
if (line == 0)
line = openfile->current->lineno;
if (column < 1)
if (column == 0)
column = openfile->placewewant + 1;
}