|
|
@ -102,19 +102,19 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *conf_path = dirname(conf);
|
|
|
|
char *conf_path = dirname(conf);
|
|
|
|
char *rel_path = src;
|
|
|
|
char *real_src = malloc(strlen(conf_path) + strlen(src) + 2);
|
|
|
|
src = malloc(strlen(conf_path) + strlen(src) + 2);
|
|
|
|
if (!real_src) {
|
|
|
|
if (!src) {
|
|
|
|
free(src);
|
|
|
|
free(rel_path);
|
|
|
|
|
|
|
|
free(conf);
|
|
|
|
free(conf);
|
|
|
|
sway_log(SWAY_ERROR, "Unable to allocate memory");
|
|
|
|
sway_log(SWAY_ERROR, "Unable to allocate memory");
|
|
|
|
return cmd_results_new(CMD_FAILURE,
|
|
|
|
return cmd_results_new(CMD_FAILURE,
|
|
|
|
"Unable to allocate resources");
|
|
|
|
"Unable to allocate resources");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
snprintf(src, strlen(conf_path) + strlen(src) + 2, "%s/%s", conf_path, rel_path);
|
|
|
|
snprintf(real_src, strlen(conf_path) + strlen(src) + 2, "%s/%s", conf_path, src);
|
|
|
|
free(rel_path);
|
|
|
|
free(src);
|
|
|
|
free(conf);
|
|
|
|
free(conf);
|
|
|
|
|
|
|
|
src = real_src;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool can_access = access(src, F_OK) != -1;
|
|
|
|
bool can_access = access(src, F_OK) != -1;
|
|
|
|