summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Mtree.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-04 14:40:40 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-04 14:40:40 +0000
commit8a3fdf46bd93e71794fcec29cb31017529d8ec57 (patch)
tree8721baf5d52b0079af9d143523c9b5d0a8cd2bef /usr.sbin/pkg_add/OpenBSD/Mtree.pm
parentcc4e44748b6a845f1f2d35fc2fe8753cb8b89300 (diff)
some minor systematic changes.
- mark all regexps I can with /o if they can be compiled once. - turn $o->method() into $o->method - remove unneeded prototypes - reduce split /re/ into split "string" where possible.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Mtree.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Mtree.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Mtree.pm b/usr.sbin/pkg_add/OpenBSD/Mtree.pm
index c20706dba0a..1b4607122e9 100644
--- a/usr.sbin/pkg_add/OpenBSD/Mtree.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Mtree.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Mtree.pm,v 1.3 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: Mtree.pm,v 1.4 2007/06/04 14:40:39 espie Exp $
#
# Copyright (c) 2004-2005 Marc Espie <espie@openbsd.org>
#
@@ -29,18 +29,18 @@ sub parse_fh
local $_;
while(<$fh>) {
chomp;
- s/^\s*//;
- next if /^\#/ || /^\//;
- s/\s.*$//;
- next if /^$/;
+ s/^\s*//o;
+ next if /^\#/o || /^\//o;
+ s/\s.*$//o;
+ next if /^$/o;
if ($_ eq '..') {
- $basedir =~ s|/[^/]*$||;
+ $basedir =~ s|/[^/]*$||o;
next;
} else {
$basedir.="/$_";
}
$_ = $basedir;
- while (s|/\./|/|) {}
+ while (s|/\./|/|o) {}
$mtree->{File::Spec->canonpath($_)} = 1;
}
}