mirror of
https://github.com/tmux/tmux.git
synced 2024-12-12 17:38:48 +00:00
Don't set some string formats if the string is NULL.
This commit is contained in:
parent
85531fd404
commit
a5521597b0
7
format.c
7
format.c
@ -365,6 +365,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
|
||||
unsigned long long size;
|
||||
u_int i;
|
||||
u_int idx;
|
||||
const char *cwd;
|
||||
|
||||
size = 0;
|
||||
for (i = 0; i < gd->hsize; i++) {
|
||||
@ -390,9 +391,11 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
|
||||
format_add(ft, "pane_start_command", "%s", wp->cmd);
|
||||
if (wp->cwd != NULL)
|
||||
format_add(ft, "pane_start_path", "%s", wp->cwd);
|
||||
format_add(ft, "pane_current_path", "%s", get_proc_cwd(wp->fd));
|
||||
if ((cwd = get_proc_cwd(wp->fd)) != NULL)
|
||||
format_add(ft, "pane_current_path", "%s", cwd);
|
||||
format_add(ft, "pane_pid", "%ld", (long) wp->pid);
|
||||
format_add(ft, "pane_tty", "%s", wp->tty);
|
||||
if (wp->tty != NULL)
|
||||
format_add(ft, "pane_tty", "%s", wp->tty);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user