2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhem.pl: better syntax checking for -t (Forum #111061)

git-svn-id: https://svn.fhem.de/fhem/trunk@21940 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-05-14 16:07:14 +00:00
parent f546691500
commit bd63d559b0

View File

@ -6086,7 +6086,10 @@ prepareFhemTestFile()
return if($ARGV[0] ne "-t" || @ARGV < 2);
shift @ARGV;
return if($ARGV[0] !~ m,^(.*?)([^/]+)\.t$,);
if($ARGV[0] !~ m,^(.*?)([^/]+)\.t$, || !-r $ARGV[0]) {
print STDERR "Need a .t file as argument for -t\n";
exit(1);
}
my ($dir, $fileBase) = ($1, $2);
$fhemTestFile = $ARGV[0];