aboutsummaryrefslogtreecommitdiffstats
path: root/src/actionparser.c
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-16 23:33:21 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-16 23:33:21 +0300
commitc67ce86b74fdd06a8779cff14c75fd78d1a50a31 (patch)
tree3b292ec3ac7c8e04725a6758ac0068f4ccb81ac3 /src/actionparser.c
parent7ba148fcc4ca4a504a0fb3f4091f64b1be530ee0 (diff)
downloadck-c67ce86b74fdd06a8779cff14c75fd78d1a50a31.tar.gz
ck-c67ce86b74fdd06a8779cff14c75fd78d1a50a31.tar.bz2
ck-c67ce86b74fdd06a8779cff14c75fd78d1a50a31.zip
fix bug in parser
Diffstat (limited to 'src/actionparser.c')
-rw-r--r--src/actionparser.c10
1 files 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();