diff mbox

[OSSTEST,4/6] mg-allocate: Tiny refactoring

Message ID 1475583994-30203-4-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson Oct. 4, 2016, 12:26 p.m. UTC
Break out $shareix assignment from $4.  (We are going to want to put
some code just after this point which will want to do regexp matching,
which would trash $4.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 mg-allocate | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/mg-allocate b/mg-allocate
index 9b66114..0317229 100755
--- a/mg-allocate
+++ b/mg-allocate
@@ -111,7 +111,8 @@  sub parse_1res ($) {
     my $restype= defined($2) ? $2 : 'host';
     $restype= 'share-host' if $restype eq 'S';
     my $resname= $3;
-    my $shareix= defined($4) ? $4+0 : '*';
+    my $shareix= $4;
+    $shareix= defined($shareix) ? $shareix+0 : '*';
     my $shareixcond = $shareix eq '*' ? '' : "AND shareix = $shareix";
 
     my @resnames;