From 6da07ebf5c7cfb5af40232f87c357cdb83f6b4ae Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 8 Jun 2025 10:42:21 +0100 Subject: Fix any::sessions() to really preserve cwd (mga#33738) Both the old and new implementations of sessions() used chdir() to change to the directory being searched and then tried to restore the current working directory using the return value of chdir(). But chdir() returns a boolean indicating success or failure, so that could never work. --- perl-install/any.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/perl-install/any.pm b/perl-install/any.pm index eb0782573..ab93036dc 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -1153,9 +1153,7 @@ sub sessions() { my @l; my @dir_wm = qw(xsessions wayland-sessions); foreach my $dwm (@dir_wm) { - my $old = chdir("$::prefix/usr/share/$dwm/"); - push @l, map { s/.desktop$//; $_ } glob("*.desktop"); - chdir($old); + push @l, map { s/.desktop$//; basename($_) } glob("$::prefix/usr/share/$dwm/*.desktop"); } @l; } -- cgit v1.2.1