From: Oliver Kiddle <opk@zsh.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Avoid \e in C code; building on Solaris 11
Date: Sat, 09 Dec 2023 23:41:41 +0100 [thread overview]
Message-ID: <16832-1702161701.642101@vOaD.NeTz.Fd-F> (raw)
In-Reply-To: <CAH+w=7ZuvPdqnTVvpZmhW=khZekc6DiTxM6ai6Hi0cmDnfNh5A@mail.gmail.com>
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]+/)
next prev parent reply other threads:[~2023-12-09 22:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 18:28 Oliver Kiddle
2023-12-08 22:03 ` Bart Schaefer
2023-12-08 22:15 ` Bart Schaefer
2023-12-09 23:04 ` Oliver Kiddle
2023-12-10 0:29 ` Bart Schaefer
2023-12-09 22:41 ` Oliver Kiddle [this message]
2023-12-09 23:43 ` Oliver Kiddle
2023-12-10 0:33 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16832-1702161701.642101@vOaD.NeTz.Fd-F \
--to=opk@zsh.org \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).