[libvirt] [PATCH v2 02/14] virkeyfile: define IS_ASCII instead c_isascii from gnulib

Pavel Hrdina phrdina at redhat.com
Wed Nov 20 14:48:15 UTC 2019


GLib doesn't provide alternative to c_isascii and this is the only usage
of that macro so define a replacement ourselves.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 src/util/virkeyfile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virkeyfile.c b/src/util/virkeyfile.c
index 6cd3a5168e..054a187ba2 100644
--- a/src/util/virkeyfile.c
+++ b/src/util/virkeyfile.c
@@ -21,7 +21,6 @@
 #include <config.h>
 
 
-#include "c-ctype.h"
 #include "virlog.h"
 #include "viralloc.h"
 #include "virfile.h"
@@ -78,6 +77,7 @@ struct _virKeyFileParserCtxt {
 #define IS_EOF (ctxt->cur >= ctxt->end)
 #define IS_EOL(c) (((c) == '\n') || ((c) == '\r'))
 #define IS_BLANK(c) (((c) == ' ') || ((c) == '\t'))
+#define IS_ASCII(c) ((c) < 128)
 #define CUR (*ctxt->cur)
 #define NEXT if (!IS_EOF) ctxt->cur++;
 
@@ -110,7 +110,7 @@ static int virKeyFileParseGroup(virKeyFileParserCtxtPtr ctxt)
     VIR_FREE(ctxt->groupname);
 
     name = ctxt->cur;
-    while (!IS_EOF && c_isascii(CUR) && CUR != ']')
+    while (!IS_EOF && IS_ASCII(CUR) && CUR != ']')
         ctxt->cur++;
     if (CUR != ']') {
         virKeyFileError(ctxt, VIR_ERR_CONF_SYNTAX, "cannot find end of group name, expected ']'");
-- 
2.23.0




More information about the libvir-list mailing list