summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2017-02-05 14:00:43 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2017-02-05 14:00:43 +0000
commit6b1109471883a3bd25507e5b3bfc35bcb65ad589 (patch)
treeeb718655d07093f2a73ef1a6d526d7dabdf1577b
parent83820c6ff581a794cd658fb13e7fd1e60b02324a (diff)
Use a non-greedy regular expression for the installpath url.
This ensures, that a trailing whitespace does not break pkg_add. OK espie@
-rw-r--r--usr.sbin/pkg_add/OpenBSD/State.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/State.pm b/usr.sbin/pkg_add/OpenBSD/State.pm
index 3f6e4282474..bd72d5d7854 100644
--- a/usr.sbin/pkg_add/OpenBSD/State.pm
+++ b/usr.sbin/pkg_add/OpenBSD/State.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: State.pm,v 1.40 2016/10/03 13:58:09 espie Exp $
+# $OpenBSD: State.pm,v 1.41 2017/02/05 14:00:42 rpe Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
@@ -39,10 +39,10 @@ sub read_file
next if m/^\s*$/;
my ($cmd, $k, $v, $add);
my $h = $self;
- if (($cmd, $k, $add, $v) = m/^\s*(.*?)\.(.*?)\s*(\+?)\=\s*(.*)\s*$/) {
+ if (($cmd, $k, $add, $v) = m/^\s*(.*?)\.(.*?)\s*(\+?)\=\s*(.*?)\s*$/) {
next unless $cmd eq $state->{cmd};
my $h = $self->{cmd} = {};
- } elsif (($k, $add, $v) = m/^\s*(.*?)\s*(\+?)\=\s*(.*)\s*$/) {
+ } elsif (($k, $add, $v) = m/^\s*(.*?)\s*(\+?)\=\s*(.*?)\s*$/) {
} else {
# bad line: should we say so ?
$state->errsay("Bad line in #1: #2 (#3)",