gnome-build 1 line patch - fix crash when parsing complex macros



This ia a patch that needs to be applied directly to AmFiles.pm. 
Actualy it might be easier to just edit the file by hand.  It changes
the regex that deals with complex macros.  I was trying to load metacity
into Anjuta2 and it would always crash.  Turns out the src/Makefile.am
was causing it because it included two complex macro replacements on the
same line:

desktopfiles_DATA = $(desktopfiles_in_files:.desktop.in=.desktop)
schema_DATA = $(schema_in_files:.schemas.in=.schemas)
EXTRA_DIST=$(desktopfiles_DATA) $(IMAGES) $(schema_DATA) ...

What would happen is when the parser got to the EXTRA_DIST line the
regex was set up to look for the '$(' read any characters until it
reached the LAST ')' -- (.*)\)  I simply changed the regex to read any
character except the ')' -- (.*!\))\)

This seems to work as I don't crash anymore but I have not idea if the
output is correct (though everything seems to be in order). 

The patch is attached.

--
J5
--- AmFiles.pm	Sun Nov  3 21:31:53 2002
+++ AmFiles.pm.new	Sun Nov  3 21:32:40 2002
@@ -934,7 +934,7 @@
     }
 
     # Expand substitution macros $(macro:search=replace)
-    while ($source =~ /\$\((\w*):(.+)=(.*)\)/) {
+    while ($source =~ /\$\((\w*):(.+)=(.*!))\)/) {
 	$var_name = $1;
 	my ($search, $replace) = ($2, $3);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]