Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Avoid \e in C code; building on Solaris 11



Bart Schaefer wrote:
>     Annoyingly, it does leave a size zero
>     Src/builtin.syms and make clean then doesn't delete that (it fails) and
>     a subsequent attempt with gawk then fails to compile builtin.c.
>
> "(it fails)" means "make clean" actually returns error, or just that it doesn't
> have a rule for removing .syms files?

make clean returns an error. Looks like the Src/Makemod tries to recurse
into Src/Builtins and that doesn't contain a Makefile. It had never got
far enough to create it.

> Would it work to prefix the awk recipe with "-" to ignore that error, and then
> append another line to that recipe to clean up on awk failure?

If you use an initial -, I don't think a subsequent line can get the
return status. make uses separate shell instances for each line. The
best I can think of is to append || (rm $@ && false)
However, after taking another look at the awk script, I think the
following patch is the best solution - using the octal escape \075 for
the equals.
  awk '/=/'  is a syntax error
  gawk '/\=/' complains that `\=' is not a known regexp operator
And while it may be less readable, both are happy with '/\075/'

Oliver

diff --git a/Src/makepro.awk b/Src/makepro.awk
index f69660531..0d53c5850 100644
--- a/Src/makepro.awk
+++ b/Src/makepro.awk
@@ -121,7 +121,7 @@ BEGIN {
 		# initialiser.
 		dcltor = substr(line, 1, RLENGTH-1)
 		line = substr(line, RLENGTH+1)
-		sub(/=.*$/, "", dcltor)
+		sub(/\075.*$/, "", dcltor)
 		match(dcltor, /^([^_0-9A-Za-z]| const )*/)
 		dcltor = substr(dcltor, 1, RLENGTH) "@+" substr(dcltor, RLENGTH+1)
 		match(dcltor, /^.*@\+[_0-9A-Za-z]+/)




Messages sorted by: Reverse Date, Date, Thread, Author