aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2018-03-16 16:19:18 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-03-16 16:44:30 +0100
commit0b507bb73138c636fd0ad6f2321624aae1346d58 (patch)
treec266cd84932f4212955ae8c3ce88155f14764a19
parente7ef3c4ce95a21cfcd0988d493f636e1d0115871 (diff)
downloadst-0b507bb73138c636fd0ad6f2321624aae1346d58.tar.gz
st-0b507bb73138c636fd0ad6f2321624aae1346d58.tar.bz2
Fix title initialization
-rw-r--r--x.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/x.c b/x.c
index 06e53d3..d0b26ac 100644
--- a/x.c
+++ b/x.c
@@ -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);