Don't rely on backquote_command to split lines

This commit is contained in:
Jamie Cameron
2014-02-10 09:47:18 -08:00
parent e93b665cdf
commit 0b75eedffd

View File

@@ -22,7 +22,8 @@ $package_dir = "/var/db/pkg";
sub use_pkg_ng
{
return 0 if (!-x "/usr/sbin/pkg");
local @lines = &backquote_command("/usr/sbin/pkg info 2>/dev/null </dev/null");
local @lines = split(/\n/, &backquote_command(
"/usr/sbin/pkg info 2>/dev/null </dev/null"));
return @lines > 1 ? 1 : 0;
}