From 2da94bb332d16452835f6ab257acfe1f17e654b7 Mon Sep 17 00:00:00 2001 From: espie Date: Sun, 27 Jul 2014 22:19:18 +0000 Subject: [PATCH] make sure makewhatis shows error messages without unsightly CODE() refs --- usr.sbin/pkg_add/OpenBSD/State.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg_add/OpenBSD/State.pm b/usr.sbin/pkg_add/OpenBSD/State.pm index 89270c1a6da..e999eaf4ac5 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.31 2014/07/08 16:52:47 espie Exp $ +# $OpenBSD: State.pm,v 1.32 2014/07/27 22:19:18 espie Exp $ # # Copyright (c) 2007-2014 Marc Espie # @@ -432,6 +432,12 @@ sub system my $self = shift; my $r = $self->_system(@_); if ($r != 0) { + if (ref $_[0] eq 'CODE') { + shift; + } + if (ref $_[0] eq 'CODE') { + shift; + } $self->say("system(#1) failed: #2", join(", ", @_), $self->child_error); } -- 2.20.1