Commit 97c1baf3 authored by Mac Newbold's avatar Mac Newbold
Browse files

Fixed a blank line problem in the links section, fixed the regular expression for lans.

parent 1c67ae1b
......@@ -196,7 +196,9 @@ foreach (@links) {
push(@newlinks,"$_ 0.0");
}
}
&ir_set("/topology/links",join("\n",@newlinks) . "\n");
if ($#newlinks != -1) {
&ir_set("/topology/links",join("\n",@newlinks) . "\n");
}
# Set lan loss
$raw = eval{&ir_get("/topology/lans")};
......@@ -207,7 +209,8 @@ if ($@) {
@lans = split("\n",$raw);
@newlans = ();
foreach (@lans) {
($lan,$prefix,$postfix) = /^([^ ]+) ("[^\"]+" [^ ]+ [^ ]+)[ \t]+(.*)$/;
($lan,$prefix,$postfix) =
/^([^ ]+) (\"[^\"]+\" [^ ]+ [^ ]+)(?:[ \t]+(.*))?$/;
if (defined($lanloss{$lan})) {
$loss = $lanloss{$lan}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment