From 6bcd2f46c95f09e12145a3ae8609c62f102030ee Mon Sep 17 00:00:00 2001 From: lissav Date: Sun, 19 Jul 2009 13:27:33 +0000 Subject: [PATCH] fix defect 2823133 noderange expansion incorrect, for example node19+2 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3828 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NodeRange.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 53eaea329..20ccbe89c 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -144,10 +144,10 @@ sub expandatom { if ($atom =~ m/\+/) { # process the + operator $atom =~ m/^(.*)([0-9]+)([^0-9\+]*)\+([0-9]+)/; - my $pref=$1; - my $startnum=$2; + my ($front, $increment) = split(/\+/, $atom, 2); + my ($pref, $startnum, $dom) = $front =~ /^(.*?)(\d+)(\..+)?$/; my $suf=$3; - my $end=$4+$startnum; + my $end=$startnum+$increment; my $endnum = sprintf("%d",$end); if (length ($startnum) > length ($endnum)) { $endnum = sprintf("%0".length($startnum)."d",$end);