artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6e5c9e
)
allow state->new to deduce the command name from $0
author
espie
<espie@openbsd.org>
Wed, 11 Jul 2018 09:54:49 +0000
(09:54 +0000)
committer
espie
<espie@openbsd.org>
Wed, 11 Jul 2018 09:54:49 +0000
(09:54 +0000)
usr.sbin/pkg_add/OpenBSD/State.pm
patch
|
blob
|
history
diff --git
a/usr.sbin/pkg_add/OpenBSD/State.pm
b/usr.sbin/pkg_add/OpenBSD/State.pm
index
18adfde
..
f430b3a
100644
(file)
--- 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.5
2 2018/05/16 10:02:40
espie Exp $
+# $OpenBSD: State.pm,v 1.5
3 2018/07/11 09:54:49
espie Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
@@
-105,6
+105,10
@@
sub new
{
my $class = shift;
my $cmd = shift;
+ if (!defined $cmd) {
+ $cmd = $0;
+ $cmd =~ s,.*/,,;
+ }
my $o = bless {cmd => $cmd}, $class;
$o->init(@_);
return $o;