]> git.sur5r.net Git - i3/i3/blobdiff - src/config_parser.c
Merge branch 'master' of https://github.com/ton/i3 into ton-master
[i3/i3] / src / config_parser.c
index ee02c3935354bf664189ed363d9098b7a810bff1..24cebcece9707755087d83928a49030629ecea63 100644 (file)
@@ -840,7 +840,7 @@ static char *migrate_config(char *input, off_t size) {
  * parse_config and possibly launching i3-nagbar.
  *
  */
-void parse_file(const char *f) {
+bool parse_file(const char *f, bool use_nagbar) {
     SLIST_HEAD(variables_head, Variable) variables = SLIST_HEAD_INITIALIZER(&variables);
     int fd, ret, read_bytes = 0;
     struct stat stbuf;
@@ -1000,7 +1000,7 @@ void parse_file(const char *f) {
 
     check_for_duplicate_bindings(context);
 
-    if (context->has_errors || context->has_warnings) {
+    if (use_nagbar && (context->has_errors || context->has_warnings)) {
         ELOG("FYI: You are using i3 version " I3_VERSION "\n");
         if (version == 3)
             ELOG("Please convert your configfile first, then fix any remaining errors (see above).\n");
@@ -1030,6 +1030,8 @@ void parse_file(const char *f) {
         free(pageraction);
     }
 
+    bool has_errors = context->has_errors;
+
     FREE(context->line_copy);
     free(context);
     free(new);
@@ -1042,6 +1044,8 @@ void parse_file(const char *f) {
         SLIST_REMOVE_HEAD(&variables, variables);
         FREE(current);
     }
+
+    return !has_errors;
 }
 
 #endif