]> git.sur5r.net Git - i3/i3/blobdiff - libi3/string.c
Detect base 16 in cmd criteria
[i3/i3] / libi3 / string.c
index a28cc899195f8fc0bfe23b4f05a4caccc167b2d5..e6297f9eed89b0282a2b104fab360921eb723b07 100644 (file)
@@ -114,10 +114,9 @@ i3String *i3string_from_ucs2(const xcb_char2b_t *from_ucs2, size_t num_glyphs) {
  * Note that this will not free the source string.
  */
 i3String *i3string_copy(i3String *str) {
-    if (str->is_markup)
-        return i3string_from_markup(i3string_as_utf8(str));
-    else
-        return i3string_from_utf8(i3string_as_utf8(str));
+    i3String *copy = i3string_from_utf8(i3string_as_utf8(str));
+    copy->is_markup = str->is_markup;
+    return copy;
 }
 
 /*
@@ -179,6 +178,13 @@ bool i3string_is_markup(i3String *str) {
     return str->is_markup;
 }
 
+/*
+ * Set whether the i3String should use Pango markup.
+ */
+void i3string_set_markup(i3String *str, bool is_markup) {
+    str->is_markup = is_markup;
+}
+
 /*
  * Returns the number of glyphs in an i3String.
  *