if a user has many snapshots, the length goes negative and produces wrong indentation, so clamp it at 0
reported by a user in the forum: https://forum.proxmox.com/threads/non-threaded-listsnaphost-view.105740/ Signed-off-by: Dominik Csapak <d.csa...@proxmox.com> --- for many snapshots this still looks weird, but has a consistent indentation. to do it completely right, we'd have to iterate twice and find the longest line first and use that as width for the first column. not sure if worth the effort. src/PVE/GuestHelpers.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/GuestHelpers.pm b/src/PVE/GuestHelpers.pm index 970c460..0c8ed66 100644 --- a/src/PVE/GuestHelpers.pm +++ b/src/PVE/GuestHelpers.pm @@ -157,6 +157,7 @@ sub print_snapshot_tree { } my $len = 30 - length($prefix); # for aligning the description + $len = 0 if $len < 0; printf("%s %-${len}s %-23s %s\n", $prefix, $root, $timestring, $description); if ($e->{children}) { -- 2.30.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel