And get it right this time... don't leak if it is an empty string either.

pull/1/head
nicm 2013-10-11 08:03:43 +00:00
parent 17ec688ced
commit 98b81e9834
1 changed files with 6 additions and 3 deletions

View File

@ -357,9 +357,12 @@ format_get_command(struct window_pane *wp)
cmd = get_proc_name(wp->fd, wp->tty);
if (cmd == NULL || *cmd == '\0') {
cmd = wp->cmd;
if (cmd == NULL || *cmd == '\0')
cmd = wp->shell;
free(cmd);
cmd = xstrdup(wp->cmd);
if (cmd == NULL || *cmd == '\0') {
free(cmd);
cmd = xstrdup(wp->shell);
}
}
out = parse_window_name(cmd);
free(cmd);