This commit is contained in:
Denis Doria 2016-06-07 10:06:06 +02:00
commit 7267314ab1
2 changed files with 17 additions and 2 deletions

View file

@ -2146,6 +2146,8 @@ static int compare_set_qsort(const void *_l, const void *_r) {
}
static struct cmd_results *cmd_set(int argc, char **argv) {
char *tmp;
int size;
struct cmd_results *error = NULL;
if (!config->reading) return cmd_results_new(CMD_FAILURE, "set", "Can only be used in config file.");
if ((error = checkarg(argc, "set", EXPECTED_AT_LEAST, 2))) {
@ -2153,7 +2155,15 @@ static struct cmd_results *cmd_set(int argc, char **argv) {
}
if (argv[0][0] != '$') {
return cmd_results_new(CMD_FAILURE, "set", "Malformed variable assignment, name has to start with $");
sway_log(L_INFO, "Warning: variable '%s' doesn't start with $", argv[0]);
size = asprintf(&tmp, "%s%s", "$", argv[0]);
if (size == -1) {
return cmd_results_new(CMD_FAILURE, "set", "Not possible to create variable $'%s'", argv[0]);
}
argv[0] = strdup(tmp);
free(tmp);
}
struct sway_variable *var = NULL;
@ -3037,7 +3047,7 @@ static struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) {
}
static struct cmd_results *bar_cmd_tray_output(int argc, char **argv) {
sway_log(L_ERROR, "warning: tray_output is not supported on wayland");
sway_log(L_ERROR, "Warning: tray_output is not supported on wayland");
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -388,6 +388,11 @@ static bool load_include_config(const char *path, const char *parent_dir, struct
char *real_path = realpath(full_path, NULL);
free(full_path);
if (real_path == NULL) {
sway_log(L_DEBUG, "%s not found.", path);
return false;
}
// check if config has already been included
int j;
for (j = 0; j < config->config_chain->length; ++j) {