Patchwork [Bug,bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error."

login
register
mail settings
Submitter Daniel Richard G.
Date Jan. 6, 2013, 7:56 p.m.
Message ID <1357502192.20273.140661174132361.1ECA78EE@webmail.messagingengine.com>
Download mbox | patch
Permalink /patch/209797/
State New
Headers show

Comments

Daniel Richard G. - Jan. 6, 2013, 7:56 p.m.
On Sun, 2013 Jan  6 18:45+0100, Andreas Schwab wrote:
>
> >  	sub(".* " name "\\(", "", flags)
> > -	if (flags ~ "^{")
> > +	if (flags ~ "^\{")
> >  	{
> > -		sub ("^{", "", flags)
> > +		sub ("^\{", "", flags)
> >  		sub("}\\).*", "", flags)
> 
> You need to escape the backslash inside a string.

Revised patch attached; awk behavior/output is same as before.


--Daniel

Patch

Index: gcc/opt-functions.awk
===================================================================
--- gcc/opt-functions.awk	(revision 194916)
+++ gcc/opt-functions.awk	(working copy)
@@ -62,9 +62,9 @@ 
 	if (flags !~ " " name "\\(")
 		return ""
 	sub(".* " name "\\(", "", flags)
-	if (flags ~ "^{")
+	if (flags ~ "^\\{")
 	{
-		sub ("^{", "", flags)
+		sub ("^\\{", "", flags)
 		sub("}\\).*", "", flags)
 	}
 	else