startup: do not accept stray characters after a "+" on the command line

After a "+" only c, r, C, and R are valid characters,
and only when immediately followed by / or ?.

This fixes https://savannah.gnu.org/bugs/?60667.

Bug existed since version 4.4, commit 2326bf6,
since searching at startup with +/ or +? was introduced.
master
Benno Schulenberg 2021-05-25 12:05:29 +02:00
parent 30bafc70cc
commit 8797ada815
1 changed files with 1 additions and 1 deletions

View File

@ -2403,7 +2403,7 @@ int main(int argc, char **argv)
optind++; optind++;
} else } else
#endif #endif
if (!parse_line_column(&argv[optind++][n], &givenline, &givencol)) if (!parse_line_column(&argv[optind++][1], &givenline, &givencol))
statusline(ALERT, _("Invalid line or column number")); statusline(ALERT, _("Invalid line or column number"));
} }