]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/child.c
Merge pull request #2507 from stapelberg/autotools
[i3/i3] / i3bar / src / child.c
index 295eb76f9ff162b781a1d4049690d6d75cd7c9b7..60ab462a5a73fba00e62b11e93f79439c86f265b 100644 (file)
@@ -7,6 +7,8 @@
  * child.c: Getting input for the statusline
  *
  */
+#include "common.h"
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -25,8 +27,6 @@
 #include <yajl/yajl_gen.h>
 #include <paths.h>
 
-#include "common.h"
-
 /* Global variables for child_*() */
 i3bar_child child;
 
@@ -361,11 +361,13 @@ static void read_flat_input(char *buffer, int length) {
     I3STRING_FREE(first->full_text);
     /* Remove the trailing newline and terminate the string at the same
      * time. */
-    if (buffer[length - 1] == '\n' || buffer[length - 1] == '\r')
+    if (buffer[length - 1] == '\n' || buffer[length - 1] == '\r') {
         buffer[length - 1] = '\0';
-    else
+    } else {
         buffer[length] = '\0';
-    first->full_text = i3string_from_markup(buffer);
+    }
+
+    first->full_text = i3string_from_utf8(buffer);
 }
 
 static bool read_json_input(unsigned char *input, int length) {