master hovercats/oakiss / pkg / util-linux / patch / 0001-Don-t-omit-second-operand-to-operator.patch
 1From e7bd9ecb3e914918a91c1f2f25533b943cd787bd Mon Sep 17 00:00:00 2001
 2From: Michael Forney <mforney@mforney.org>
 3Date: Tue, 18 Jun 2019 01:38:53 -0700
 4Subject: [PATCH] Don't omit second operand to `?` operator
 5
 6---
 7 libfdisk/src/bsd.c      | 2 +-
 8 libfdisk/src/dos.c      | 2 +-
 9 libfdisk/src/gpt.c      | 2 +-
10 libfdisk/src/parttype.c | 2 +-
11 libfdisk/src/sgi.c      | 2 +-
12 libfdisk/src/sun.c      | 2 +-
13 6 files changed, 6 insertions(+), 6 deletions(-)
14
15diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
16index cb45e3f1a..ba73b596a 100644
17--- a/libfdisk/src/bsd.c
18+++ b/libfdisk/src/bsd.c
19@@ -116,7 +116,7 @@ static struct fdisk_parttype *bsd_partition_parttype(
20 {
21 	struct fdisk_parttype *t
22 		= fdisk_label_get_parttype_from_code(cxt->label, p->p_fstype);
23-	return t ? : fdisk_new_unknown_parttype(p->p_fstype, NULL);
24+	return t ? t : fdisk_new_unknown_parttype(p->p_fstype, NULL);
25 }
26 
27 
28diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
29index c88d2a4f2..9bcf1ba55 100644
30--- a/libfdisk/src/dos.c
31+++ b/libfdisk/src/dos.c
32@@ -141,7 +141,7 @@ static struct fdisk_parttype *dos_partition_parttype(
33 {
34 	struct fdisk_parttype *t
35 		= fdisk_label_get_parttype_from_code(cxt->label, p->sys_ind);
36-	return t ? : fdisk_new_unknown_parttype(p->sys_ind, NULL);
37+	return t ? t : fdisk_new_unknown_parttype(p->sys_ind, NULL);
38 }
39 
40 /*
41diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
42index b11c325f8..85040fb6b 100644
43--- a/libfdisk/src/gpt.c
44+++ b/libfdisk/src/gpt.c
45@@ -264,7 +264,7 @@ static struct fdisk_parttype *gpt_partition_parttype(
46 
47 	guid_to_string(&guid, str);
48 	t = fdisk_label_get_parttype_from_string(cxt->label, str);
49-	return t ? : fdisk_new_unknown_parttype(0, str);
50+	return t ? t : fdisk_new_unknown_parttype(0, str);
51 }
52 
53 static void gpt_entry_set_type(struct gpt_entry *e, struct gpt_guid *uuid)
54diff --git a/libfdisk/src/parttype.c b/libfdisk/src/parttype.c
55index 8e36ada74..cb555d4c9 100644
56--- a/libfdisk/src/parttype.c
57+++ b/libfdisk/src/parttype.c
58@@ -496,7 +496,7 @@ struct fdisk_parttype *fdisk_label_advparse_parttype(
59 
60 	if (res)
61 		DBG(PARTTYPE, ul_debugobj(res, "returns parsed '%s' [%s] partition type",
62-				res->name, res->typestr ? : ""));
63+				res->name, res->typestr ? res->typestr : ""));
64 	return res;
65 }
66 
67diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c
68index 71abedd3f..eefa4f1dc 100644
69--- a/libfdisk/src/sgi.c
70+++ b/libfdisk/src/sgi.c
71@@ -353,7 +353,7 @@ static struct fdisk_parttype *sgi_get_parttype(struct fdisk_context *cxt, size_t
72 		return NULL;
73 
74 	t = fdisk_label_get_parttype_from_code(cxt->label, sgi_get_sysid(cxt, n));
75-	return t ? : fdisk_new_unknown_parttype(sgi_get_sysid(cxt, n), NULL);
76+	return t ? t : fdisk_new_unknown_parttype(sgi_get_sysid(cxt, n), NULL);
77 }
78 
79 /* fdisk_get_partition() backend */
80diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c
81index cd965ab13..c0f757c3e 100644
82--- a/libfdisk/src/sun.c
83+++ b/libfdisk/src/sun.c
84@@ -831,7 +831,7 @@ static struct fdisk_parttype *sun_get_parttype(
85 
86 	t = fdisk_label_get_parttype_from_code(cxt->label,
87 			be16_to_cpu(sunlabel->vtoc.infos[n].id));
88-	return t ? : fdisk_new_unknown_parttype(be16_to_cpu(sunlabel->vtoc.infos[n].id), NULL);
89+	return t ? t : fdisk_new_unknown_parttype(be16_to_cpu(sunlabel->vtoc.infos[n].id), NULL);
90 }
91 
92 
93-- 
942.49.0
95