]> Sergey Matveev's repositories - st.git/blobdiff - x.c
Reset title when an empty title string is given
[st.git] / x.c
diff --git a/x.c b/x.c
index b36fb8c8f0ce6272d59224ac28d2b92333128507..bd236869526584bdc5f30fd719535122164c5a52 100644 (file)
--- a/x.c
+++ b/x.c
@@ -1617,6 +1617,9 @@ xseticontitle(char *p)
        XTextProperty prop;
        DEFAULT(p, opt_title);
 
+       if (p[0] == '\0')
+               p = opt_title;
+
        if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
                                        &prop) != Success)
                return;
@@ -1631,6 +1634,9 @@ xsettitle(char *p)
        XTextProperty prop;
        DEFAULT(p, opt_title);
 
+       if (p[0] == '\0')
+               p = opt_title;
+
        if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
                                        &prop) != Success)
                return;