mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
util: Make virStringHasCaseSuffix() return bool
It's a predicate, so bool is the appropriate return type. Signed-off-by: Andrea Bolognani <abologna@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
696239ba6f
commit
fcf78395d7
@ -1248,7 +1248,7 @@ virStringHasSuffix(const char *str,
|
|||||||
return STREQ(str + len - suffixlen, suffix);
|
return STREQ(str + len - suffixlen, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
bool
|
||||||
virStringHasCaseSuffix(const char *str,
|
virStringHasCaseSuffix(const char *str,
|
||||||
const char *suffix)
|
const char *suffix)
|
||||||
{
|
{
|
||||||
@ -1256,7 +1256,7 @@ virStringHasCaseSuffix(const char *str,
|
|||||||
int suffixlen = strlen(suffix);
|
int suffixlen = strlen(suffix);
|
||||||
|
|
||||||
if (len < suffixlen)
|
if (len < suffixlen)
|
||||||
return 0;
|
return false;
|
||||||
|
|
||||||
return STRCASEEQ(str + len - suffixlen, suffix);
|
return STRCASEEQ(str + len - suffixlen, suffix);
|
||||||
}
|
}
|
||||||
|
@ -290,8 +290,8 @@ char *virStringReplace(const char *haystack,
|
|||||||
|
|
||||||
bool virStringHasSuffix(const char *str,
|
bool virStringHasSuffix(const char *str,
|
||||||
const char *suffix);
|
const char *suffix);
|
||||||
int virStringHasCaseSuffix(const char *str,
|
bool virStringHasCaseSuffix(const char *str,
|
||||||
const char *suffix);
|
const char *suffix);
|
||||||
int virStringStripSuffix(char *str,
|
int virStringStripSuffix(char *str,
|
||||||
const char *suffix) ATTRIBUTE_RETURN_CHECK;
|
const char *suffix) ATTRIBUTE_RETURN_CHECK;
|
||||||
int virStringMatchesNameSuffix(const char *file,
|
int virStringMatchesNameSuffix(const char *file,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user