Commit 8b80ec3e authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -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)) {
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment