diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 9e97f3e..934da9e 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -1794,6 +1794,7 @@ gui_window_title_set () void gui_window_title_reset () { + char *shell, *shellname; char *envterm = getenv ("TERM"); char *envshell = getenv ("SHELL"); @@ -1813,14 +1814,13 @@ gui_window_title_reset () printf ("\33]0;%s\7", "Terminal"); else if (strcmp (envterm, "screen") == 0) { - char *shell, *shellname; if (envshell) { shell = strdup (envterm); - shellname = basename(shell); if (shell) { - printf ("\033k%s\033\\", shellname); + shellname = basename (shell); + printf ("\033k%s\033\\", (shellname) ? shellname : shell); free (shell); } else