From 820c965b72c66c23c6042371995ca64879ac1902 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 9 May 2012 13:51:49 -0700 Subject: [PATCH] Allow Shorewall::Config::in_hex() to accept an argument already expressed in hex. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index e230d5711..9e11cb68c 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1030,7 +1030,9 @@ sub normalize_hex( $ ) { # Return the argument expressed in Hex # sub in_hex( $ ) { - sprintf '0x%x', $_[0]; + my $value = $_[0]; + + $value =~ /^0x/ ? $value : sprintf '0x%x', $_[0]; } sub in_hex2( $ ) {