diff options
Diffstat (limited to 'src/confparser.c')
-rw-r--r-- | src/confparser.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/confparser.c b/src/confparser.c index 5754dfa..948623c 100644 --- a/src/confparser.c +++ b/src/confparser.c @@ -139,17 +139,19 @@ void free_conf(Conf *conf) { } int init_create_config_file(UserOpt *opt) { - if (!util_file_exists(list_get_at(opt->args, 0))) { + char absVCdir[STR_L]; + if (!util_file_exists(list_get_at(opt->args, 0), absVCdir)) { printf("Version control directory: %s\ndoes not exist.\n", list_get_at(opt->args, 0)); return 1; } - if (!util_file_exists(list_get_at(opt->args, 1))) { + char absSRdir[STR_L]; + if (!util_file_exists(list_get_at(opt->args, 1), absSRdir)) { printf("Secret directory: %s\ndoes not exist.\n", list_get_at(opt->args, 1)); return 1; } - if (!util_file_exists(opt->confDir)) { + if (!util_file_exists(opt->confDir, NULL)) { util_mkdir(opt->confDir); } @@ -162,12 +164,12 @@ int init_create_config_file(UserOpt *opt) { char tmp[200]; strcpy(tmp, "version_control_dir = "); - strcat(tmp, list_get_at(opt->args, 0)); + strcat(tmp, absVCdir); strcat(tmp, "\n"); fputs(tmp, f); strcpy(tmp, "secret_dir = "); - strcat(tmp, list_get_at(opt->args, 1)); + strcat(tmp, absSRdir); strcat(tmp, "\n"); fputs(tmp, f); |