mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: Rename virFileHasSuffix() to virStringHasCaseSuffix()
Despite its name, this is really just a general-purpose string manipulation function, so it should be moved to the virstring module and renamed accordingly. In addition to the obvious s/File/String/, also tweak the name to make it clear that the presence of the suffix is verified using case-insensitive comparison. A few trivial whitespace changes are squashed in. Signed-off-by: Andrea Bolognani <abologna@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
@@ -41,7 +41,7 @@ static int
|
||||
testSchemaFile(const void *args)
|
||||
{
|
||||
const struct testSchemaData *data = args;
|
||||
bool shouldFail = virFileHasSuffix(data->xml_path, "-invalid.xml");
|
||||
bool shouldFail = virStringHasCaseSuffix(data->xml_path, "-invalid.xml");
|
||||
xmlDocPtr xml = NULL;
|
||||
int ret = -1;
|
||||
|
||||
@@ -82,7 +82,7 @@ testSchemaDir(const char *schema,
|
||||
return -1;
|
||||
|
||||
while ((rc = virDirRead(dir, &ent, dir_path)) > 0) {
|
||||
if (!virFileHasSuffix(ent->d_name, ".xml"))
|
||||
if (!virStringHasCaseSuffix(ent->d_name, ".xml"))
|
||||
continue;
|
||||
if (ent->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user