From c67ce86b74fdd06a8779cff14c75fd78d1a50a31 Mon Sep 17 00:00:00 2001 From: Anastasis Grammenos Date: Tue, 16 Oct 2018 23:33:21 +0300 Subject: fix bug in parser --- src/actionparser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/actionparser.c b/src/actionparser.c index 10882b3..c8c70db 100644 --- a/src/actionparser.c +++ b/src/actionparser.c @@ -232,15 +232,15 @@ int get_config(UserOpt *opt) { return 0; } } - } + // rewind + pos = pos - 1; + token = opts[pos]; + } char * defaultConf = ".ck"; char * home = getenv("HOME"); opt->confDir = malloc(strlen(defaultConf) + 1 /* '/' */ + strlen(home) + 1); str_join_dirname_with_basename(opt->confDir, home, defaultConf); - // rewind - pos = pos - 1; - token = opts[pos]; return 0; } @@ -382,7 +382,7 @@ int parse_action(int argc, char* argv[], UserOpt *opt) { return -1; } - /* If the remaining arguments are < 2 + /* If the remaining arguments are < 1 * print help and exit */ if (optNum - pos < 1) { print_parser_help(); -- cgit v1.2.3