From d47d07450aed343e7a9bfd79ae6465658406fd96 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 6 Sep 2007 16:58:37 +0000 Subject: add max() --- urpm/util.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'urpm') diff --git a/urpm/util.pm b/urpm/util.pm index 261bacae..cb5dbff4 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -5,7 +5,7 @@ package urpm::util; use strict; use Exporter; our @ISA = 'Exporter'; -our @EXPORT = qw(min quotespace unquotespace +our @EXPORT = qw(min max quotespace unquotespace remove_internal_name reduce_pathname offset_pathname untaint @@ -18,6 +18,7 @@ our @EXPORT = qw(min quotespace unquotespace (our $VERSION) = q($Revision$) =~ /(\d+)/; sub min { my $n = shift; $_ < $n and $n = $_ foreach @_; $n } +sub max { my $n = shift; $_ > $n and $n = $_ foreach @_; $n } #- quoting/unquoting a string that may be containing space chars. sub quotespace { my $x = $_[0] || ''; $x =~ s/(\s)/\\$1/g; $x } -- cgit v1.2.1