X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=x.c;h=d0b26acf1b3be29aafaf82d3a888aacb4e35e6f9;hb=0b507bb73138c636fd0ad6f2321624aae1346d58;hp=f00568791f7051bca82307c08126c41dcfb9e44d;hpb=20e0da7f14cc5f30863e0b8014fa223fbaff1e30;p=st.git diff --git a/x.c b/x.c index f005687..d0b26ac 100644 --- a/x.c +++ b/x.c @@ -1,5 +1,6 @@ /* See LICENSE for license details. */ #include +#include #include #include #include @@ -780,7 +781,7 @@ xhints(void) XClassHint class = {opt_name ? opt_name : termname, opt_class ? opt_class : termname}; XWMHints wm = {.flags = InputHint, .input = 1}; - XSizeHints *sizeh = NULL; + XSizeHints *sizeh; sizeh = XAllocSizeHints(); @@ -901,7 +902,6 @@ xloadfonts(char *fontstr, double fontsize) { FcPattern *pattern; double fontval; - float ceilf(float); if (fontstr[0] == '-') { pattern = XftXlfdParse(fontstr, False, False); @@ -1492,7 +1492,7 @@ void xsettitle(char *p) { XTextProperty prop; - DEFAULT(p, "st"); + DEFAULT(p, opt_title); Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, &prop); @@ -1929,12 +1929,12 @@ main(int argc, char *argv[]) } ARGEND; run: - if (argc > 0) { - /* eat all remaining arguments */ + if (argc > 0) /* eat all remaining arguments */ opt_cmd = argv; - if (!opt_title && !opt_line) - opt_title = basename(xstrdup(argv[0])); - } + + if (!opt_title) + opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0]; + setlocale(LC_CTYPE, ""); XSetLocaleModifiers(""); cols = MAX(cols, 1);