summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2003-12-24 02:31:29 +0000
committerMarc Espie <espie@cvs.openbsd.org>2003-12-24 02:31:29 +0000
commit7bee52e0130bb3de8f1b29cc3a3ff7a50f1a62dd (patch)
treef029eec0cfad8fd8ced57975469ed4e1d49b1d64 /usr.sbin/pkg_add
parentbb218217fb73a722aa30078275edc01f31319024 (diff)
Handle mount entries without options.
Found and tested by our ubiquitous afs user, Bob Beck.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Vstat.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Vstat.pm b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
index 500dca1b799..d7708001ee9 100644
--- a/usr.sbin/pkg_add/OpenBSD/Vstat.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Vstat.pm,v 1.1 2003/12/21 18:41:23 espie Exp $
+# $OpenBSD: Vstat.pm,v 1.2 2003/12/24 02:31:28 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -45,11 +45,12 @@ sub init_dirinfo()
open(my $cmd1, "/sbin/mount|") or print STDERR "Can't run mount\n";
while (<$cmd1>) {
chomp;
- if (m/^.*?\s+on\s+(.*?)\s+type\s+.*?\s+\((.*?)\)$/) {
+ if (m/^.*?\s+on\s+(.*?)\s+type\s+.*?(?:\s+\((.*?)\))?$/) {
my ($mntpoint, $opts) = ($1, $2);
$dirinfo->{"$mntpoint"} = { mnt => $mntpoint }
unless defined $dirinfo->{"$mntpoint"};
my $i = $dirinfo->{"$mntpoint"};
+ next unless defined $opts;
for my $o (split /,\s*/, $opts) {
if ($o eq 'read-only') {
$i->{ro} = 1;