Quoting Markus Armbruster (2018-02-11 03:35:59)
> 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 <arm...@redhat.com>
> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com>
> Reviewed-by: Eric Blake <ebl...@redhat.com>

Reviewed-by: Michael Roth <mdr...@linux.vnet.ibm.com>

> ---
>  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 de12f8469a..6e5152b173 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.13.6
> 


Reply via email to