From b10dd7d443f6b46e4bef5ecc598e676a73b5895f Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Mon, 18 Nov 2019 15:11:46 +0100 Subject: [PATCH] use g_ascii_isalpha instead of c_isalpha from gnulib Signed-off-by: Pavel Hrdina Reviewed-by: Cole Robinson --- src/conf/network_conf.c | 3 +-- src/qemu/qemu_domain.c | 3 +-- src/qemu/qemu_qapi.c | 6 ++---- src/util/virconf.c | 2 +- src/util/virfile.c | 4 ++-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 6970831593..5551b5b4d5 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -37,7 +37,6 @@ #include "virxml.h" #include "viruuid.h" #include "virbuffer.h" -#include "c-ctype.h" #include "virfile.h" #include "virstring.h" @@ -482,7 +481,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName, } name = virXMLPropString(node, "name"); - if (name && (!c_isalpha(name[0]))) { + if (name && (!g_ascii_isalpha(name[0]))) { virReportError(VIR_ERR_XML_ERROR, _("Cannot use host name '%s' in network '%s'"), name, networkName); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 873a397ac6..767790bfc0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -40,7 +40,6 @@ #include "viralloc.h" #include "virlog.h" #include "virerror.h" -#include "c-ctype.h" #include "cpu/cpu.h" #include "viruuid.h" #include "virfile.h" @@ -3934,7 +3933,7 @@ qemuDomainDefNamespaceParseCommandlineArgs(qemuDomainXmlNsDefPtr nsdef, static int qemuDomainDefNamespaceParseCommandlineEnvNameValidate(const char *envname) { - if (!c_isalpha(envname[0]) && envname[0] != '_') { + if (!g_ascii_isalpha(envname[0]) && envname[0] != '_') { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid environment name, it must begin with a letter or underscore")); return -1; diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c index 8e66f9f180..e6b5ea3763 100644 --- a/src/qemu/qemu_qapi.c +++ b/src/qemu/qemu_qapi.c @@ -25,8 +25,6 @@ #include "virerror.h" #include "virlog.h" -#include "c-ctype.h" - #define VIR_FROM_THIS VIR_FROM_QEMU VIR_LOG_INIT("qemu.qemu_qapi"); @@ -165,7 +163,7 @@ virQEMUQAPISchemaTraverseObject(virJSONValuePtr cur, const char *query = virQEMUQAPISchemaTraverseContextNextQuery(ctxt); char modifier = *query; - if (!c_isalpha(modifier)) + if (!g_ascii_isalpha(modifier)) query++; /* exit on modifers for other types */ @@ -218,7 +216,7 @@ virQEMUQAPISchemaTraverseCommand(virJSONValuePtr cur, const char *querytype; char modifier = *query; - if (!c_isalpha(modifier)) + if (!g_ascii_isalpha(modifier)) query++; /* exit on modifers for other types */ diff --git a/src/util/virconf.c b/src/util/virconf.c index b67716b9ce..a9a7148701 100644 --- a/src/util/virconf.c +++ b/src/util/virconf.c @@ -556,7 +556,7 @@ virConfParseName(virConfParserCtxtPtr ctxt) SKIP_BLANKS; base = ctxt->cur; /* TODO: probably need encoding support and UTF-8 parsing ! */ - if (!c_isalpha(CUR) && + if (!g_ascii_isalpha(CUR) && !((ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) && (CUR == '.'))) { virConfError(ctxt, VIR_ERR_CONF_SYNTAX, _("expecting a name")); return NULL; diff --git a/src/util/virfile.c b/src/util/virfile.c index 3dd2b1a527..0eea66eb27 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3190,7 +3190,7 @@ virFileIsAbsPath(const char *path) return true; #ifdef WIN32 - if (c_isalpha(path[0]) && + if (g_ascii_isalpha(path[0]) && path[1] == ':' && VIR_FILE_IS_DIR_SEPARATOR(path[2])) return true; @@ -3242,7 +3242,7 @@ virFileSkipRoot(const char *path) #ifdef WIN32 /* Skip X:\ */ - if (c_isalpha(path[0]) && + if (g_ascii_isalpha(path[0]) && path[1] == ':' && VIR_FILE_IS_DIR_SEPARATOR(path[2])) return path + 3; -- GitLab