[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/30] qapi/common: Fix guardname() for funny filenam
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PULL 21/30] qapi/common: Fix guardname() for funny filenames |
Date: |
Thu, 1 Mar 2018 13:42:36 -0600 |
From: Markus Armbruster <address@hidden>
guardname() fails to return a valid C identifier for arguments
containing anything but [A-Za-z0-9_.-']. Fix that. Don't bother
protecting ticklish identifiers; header guards are all-caps, and no
ticklish identifiers are.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
---
scripts/qapi/common.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 547656c8b29..069ec3715d7 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1867,7 +1867,7 @@ def mcgen(code, **kwds):
def guardname(filename):
- return c_name(filename, protect=False).upper()
+ return re.sub(r'[^A-Za-z0-9_]', '_', filename).upper()
def guardstart(name):
--
2.14.3
- [Qemu-devel] [PULL 10/30] qapi: Touch generated files only when they change, (continued)
- [Qemu-devel] [PULL 10/30] qapi: Touch generated files only when they change, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 12/30] qapi/common: Eliminate QAPISchema.exprs, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 13/30] qapi: Lift error reporting from QAPISchema.__init__() to callers, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 15/30] qapi: Record 'include' directives in parse tree, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 11/30] qapi: Improve include file name reporting in error messages, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 08/30] qapi-gen: New common driver for code and doc generators, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 14/30] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__(), Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 16/30] qapi: Generate in source order, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 17/30] qapi: Record 'include' directives in intermediate representation, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 18/30] qapi: Rename generated qmp-marshal.c to qmp-commands.c, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 21/30] qapi/common: Fix guardname() for funny filenames,
Eric Blake <=
- [Qemu-devel] [PULL 20/30] qapi/types qapi/visit: Generate built-in stuff into separate files, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 19/30] qapi: Make code-generating visitors use QAPIGen more, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 22/30] qapi: Generate separate .h, .c for each module, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 24/30] watchdog: Consolidate QAPI into single file, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 26/30] docs/devel/writing-qmp-commands: Update for modular QAPI, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 27/30] docs: Correct outdated information on QAPI, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 30/30] qapi: Don't create useless directory qapi-generated, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 23/30] Include less of the generated modular QAPI headers, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 29/30] Fix up dangling references to qmp-commands.* in comment and doc, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 28/30] qapi: Move qapi-schema.json to qapi/, rename generated files, Eric Blake, 2018/03/01