From 47b28bd335fe279df35f746d5797a1071cb4b989 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 5 Aug 2015 22:59:06 -0400 Subject: [PATCH] Clean up config loading and launch wayland --- sway/commands.c | 3 ++- sway/config.c | 2 +- sway/main.c | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sway/commands.c b/sway/commands.c index a89290a9..4eb733ba 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -139,7 +139,8 @@ int handle_command(struct sway_config *config, char *exec) { } struct cmd_handler *handler = find_handler(handlers, sizeof(handlers) / sizeof(struct cmd_handler), cmd); if (handler == NULL) { - return 1; + fprintf(stderr, "Unknown command '%s'\n", cmd); + return 0; // TODO: return error, probably } int argc; char **argv = split_directive(exec + strlen(handler->command), &argc); diff --git a/sway/config.c b/sway/config.c index e98246ff..b93d3f8c 100644 --- a/sway/config.c +++ b/sway/config.c @@ -33,7 +33,7 @@ struct sway_config *read_config(FILE *file) { goto _continue; } - if (!handle_command(config, line)) { + if (handle_command(config, line) != 0) { success = false; } diff --git a/sway/main.c b/sway/main.c index 96294e08..9b19a2f0 100644 --- a/sway/main.c +++ b/sway/main.c @@ -26,7 +26,6 @@ void load_config() { int main(int argc, char **argv) { load_config(); - return 0; static struct wlc_interface interface = { }; if (!wlc_init(&interface, argc, argv)) {