[pve-devel] [PATCH 09/16] write_network_interfaces: better newline consistency

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jun 24 14:33:23 CEST 2015


Don't write extra newlines between sections where no options
are printed when options exist.
---
 src/PVE/INotify.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 3277fae..846eb2f 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1284,10 +1284,10 @@ NETWORKDOC
 
 	next if $printed->{$iface};
 
-	if (@options) {
-	    while (@options && $options[0]->[0] < $d->{priority}) {
+	if (@options && $options[0]->[0] < $d->{priority}) {
+	    do {
 		$raw .= (shift @options)->[1] . "\n";
-	    }
+	    } while (@options && $options[0]->[0] < $d->{priority});
 	    $raw .= "\n";
 	}
 
-- 
2.1.4





More information about the pve-devel mailing list