summaryrefslogtreecommitdiffstats
path: root/urpm/util.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-06 16:58:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-06 16:58:37 +0000
commitd47d07450aed343e7a9bfd79ae6465658406fd96 (patch)
treedcff902fe765aea95837c68235e8fe1b6c2c205c /urpm/util.pm
parente3fc0b77e2ffd2cd319f7a26c7b41a205c791e72 (diff)
downloadurpmi-d47d07450aed343e7a9bfd79ae6465658406fd96.tar
urpmi-d47d07450aed343e7a9bfd79ae6465658406fd96.tar.gz
urpmi-d47d07450aed343e7a9bfd79ae6465658406fd96.tar.bz2
urpmi-d47d07450aed343e7a9bfd79ae6465658406fd96.tar.xz
urpmi-d47d07450aed343e7a9bfd79ae6465658406fd96.zip
add max()
Diffstat (limited to 'urpm/util.pm')
-rw-r--r--urpm/util.pm3
1 files changed, 2 insertions, 1 deletions
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 }