Fix core dump on viewing invalid package log

This commit is contained in:
Matt Smith 2014-06-17 11:37:26 -05:00
parent 7145cd87d1
commit b67cdd05ab
2 changed files with 7 additions and 3 deletions

View File

@ -73,9 +73,11 @@ if(!$apkg) { // If we aren't looking for a specific package, locate the first pa
}
}
} elseif($apkg) {
$pkgwithlogging = true;
$apkgid = get_pkg_id($apkg);
$i = $apkgid;
if ($apkgid != -1) {
$pkgwithlogging = true;
$i = $apkgid;
}
}
$pgtitle = array(gettext("Status"),gettext("Package logs"));

View File

@ -612,7 +612,9 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert
$grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
if(is_array($grepinvert))
$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
if(file_exists($logfile) && filesize($logfile) == 0) {
if (is_dir($logfile)) {
$logarr = array("File $logfile is a directory.");
} elsif(file_exists($logfile) && filesize($logfile) == 0) {
$logarr = array("Log file started.");
} else {
if($config['system']['disablesyslogclog']) {