Fix use of option RunWithEndFile

This commit is contained in:
Michael RICOIS 2014-06-09 08:37:32 +00:00
parent 6a608349f5
commit e88cf15c86

View File

@ -121,9 +121,16 @@ if ( isset($opts->file) )
}
}
if ( $OptionsRunWithEndFile && !in_array( $extension, $runExtensions) ) {
//Get the realname of file IN or exit
if ( $OptionsRunWithEndFile ) {
if ( in_array( $extension, $runExtensions) ) {
$extensionLength = strlen($extension)+1;
$filenameIn = substr($filenameIn, 0, strlen($filenameIn) - $extensionLength);
$extension = '';
} else {
exit;
}
}
$lines = file($fluxBasePath . '/' . $filenameIn);
$nbLines = count($lines);