summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/pkg_create
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-04-30 13:51:33 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-04-30 13:51:33 +0000
commit3db8c55affce979a69ba3f35c85d2acf404cf715 (patch)
treea3474dab130e84d793bcd7f16953c89b9b5c5ec2 /usr.sbin/pkg_add/pkg_create
parent5ad58a43446995f79878f43a481d4d40442f974f (diff)
don't bother trying to substitute if there's no $ in the string.
According to perl's profiler, this actually accounts for *most* of the user time of pkg_create...
Diffstat (limited to 'usr.sbin/pkg_add/pkg_create')
-rw-r--r--usr.sbin/pkg_add/pkg_create3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create
index 081f065a120..3844a36238e 100644
--- a/usr.sbin/pkg_add/pkg_create
+++ b/usr.sbin/pkg_add/pkg_create
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_create,v 1.82 2007/04/30 12:39:31 espie Exp $
+# $OpenBSD: pkg_create,v 1.83 2007/04/30 13:51:32 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -316,6 +316,7 @@ my %defines;
sub dosubst
{
local $_ = shift;
+ return $_ unless m/\$/;
while (my ($k, $v) = each %defines) {
s/\$\{\Q$k\E\}/$v/g;
}