From 2d1f2cf66c93891efdc38317c9c45cc7d172e2ed Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 14 Jul 2020 11:03:25 -0400 Subject: fix + option handling, add warning --- more.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/more.c b/more.c index c3b08eb..84f1185 100644 --- a/more.c +++ b/more.c @@ -352,12 +352,13 @@ static void adjust_args(int *argc, char ***argv) } for (int i = 1; i < *argc; i++) { - if (!strcmp(**argv, "--")) { + if (!strcmp((*argv)[i], "--")) { return; } - if (**argv[0] == '+') { - **argv[0] = '-'; + if ((*argv)[i][0] == '+') { + fprintf(stderr, "more: adjusting command line option +%s to -%s\n", (*argv)[i] + 1, (*argv)[i] + 1); + (*argv)[i][0] = '-'; } } } -- cgit v1.2.1