]> git.ipfire.org Git - thirdparty/util-linux.git/commit
(s)fdisk: avoid unneeded empty lines with '--list'
authorWolfram Sang <wsa@kernel.org>
Wed, 6 May 2020 10:39:21 +0000 (12:39 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 May 2020 09:28:49 +0000 (11:28 +0200)
commit4a52959d18ecd57a90680961fc1e3c57c34bf145
tree99a1b84c8b725c863c5747204c72f4c2c15e2e79
parentb3a3b7eb1a15c5633ae890bec00fe5691b784d99
(s)fdisk: avoid unneeded empty lines with '--list'

On my system, I got two superfluous empty lines because /dev/sr0 didn't
contain a medium. Refactor the code to handle the seperator within
print_device_pt() and print it only when assigning the device worked.
This unifies handling between print_all_devices_pt and (s)fdisk because
the latter did not consider the return code for the seperator while the
former did. Also, it saves some lines of code.

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814184 (first part)
Signed-off-by: Wolfram Sang <wsa@kernel.org>
disk-utils/fdisk-list.c
disk-utils/fdisk-list.h
disk-utils/fdisk.c
disk-utils/sfdisk.c