mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
uxpty.c: stop setting DISPLAY to "(null)".
In some contexts (namely pterm on a pure Wayland system, and Uppity), seat_get_x_display() will return NULL. In that situation uxpty.c was cheerfully passing it to dupprintf regardless, which in principle is undefined behaviour and in practice was causing it to construct the silly environment string "DISPLAY=(null)". Now we handle that case by unsetenv("DISPLAY") instead.
This commit is contained in:
parent
9366a1b4d8
commit
4cd040bced
@ -1113,9 +1113,13 @@ Backend *pty_backend_create(
|
||||
* on.
|
||||
*/
|
||||
const char *x_display = seat_get_x_display(pty->seat);
|
||||
if (x_display) {
|
||||
char *x_display_env_var = dupprintf("DISPLAY=%s", x_display);
|
||||
putenv(x_display_env_var);
|
||||
/* As above, we don't free this. */
|
||||
} else {
|
||||
unsetenv("DISPLAY");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user