vncserver: extract DetectBinariesDir()

This commit is contained in:
Dmitry Maksyoma 2021-07-30 23:55:44 +12:00
parent fc732f3603
commit 5811e14b42

View File

@ -26,14 +26,7 @@
#
# First make sure we're operating in a sane environment.
$exedir = "";
$slashndx = rindex($0, "/");
if($slashndx>=0) {
$exedir = substr($0, 0, $slashndx+1);
}
if ($exedir =~ m!unix/!) {
$exedir = "/usr/bin/";
}
$exedir = &DetectBinariesDir($0);
&SanityCheck();
@ -926,3 +919,17 @@ sub RunXstartup {
}
}
}
sub DetectBinariesDir {
my $result = "";
my $slashndx = rindex($0, "/");
if($slashndx>=0) {
$result = substr($0, 0, $slashndx+1);
}
if ($result =~ m!unix/!) {
$result = "/usr/bin/";
}
return $result;
}