commit 8b80ec3e1aa701f6259cfa9e9247937c4f7611ca
parent a71a2f9a0c72fd34cb7c8d9e2641193614af0923
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 23 Jun 2017 10:25:12 +0200
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.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -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)) {
diff --git a/src/search.c b/src/search.c
@@ -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;
}