]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (script) print bootable flag only when set
authorKarel Zak <kzak@redhat.com>
Thu, 6 May 2021 15:01:48 +0000 (17:01 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 May 2021 15:01:48 +0000 (17:01 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/script.c

index 5e82d52078e3f24649e93413e0f9e085c3c08e03..51d063af75a87e331801158fa814b5d593651a6b 100644 (file)
@@ -643,7 +643,8 @@ static int write_file_json(struct fdisk_script *dp, FILE *f)
                                ul_jsonwrt_value_s(&json, "attrs", pa->attrs);
                }
 
-               ul_jsonwrt_value_boolean(&json, "bootable", fdisk_partition_is_bootable(pa));
+               if (fdisk_partition_is_bootable(pa))
+                       ul_jsonwrt_value_boolean(&json, "bootable", 1);
                ul_jsonwrt_object_close(&json);
        }