public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ciaran Woodward <ciaranwoodward@xmos.com>
To: gdb-patches@sourceware.org
Cc: Ciaran Woodward <ciaranwoodward@xmos.com>
Subject: [PATCH] [gdb/doc] Escape the '@' symbols in generated texinfo files.
Date: Wed, 29 Nov 2023 15:14:59 +0000	[thread overview]
Message-ID: <20231129151459.14738-1-ciaranwoodward@xmos.com> (raw)

'@' is a special symbol meaning 'command' in GNU texinfo.

If the GDBINIT or GDBINIT_DIR path during configuration
included an '@' character, the makeinfo command would fail,
as it interpreted the '@' in the path as a start of a command
when expanding the path in the docs.

This patch simply escapes any '@' characters in the path,
by replacing them with '@@'. This was already done for the
bugurl variable.

This was detected because the 'Jenkins' tool sometimes puts
an '@' in the workspace path.
---
Note that the generated information is still a little deficient
if you're building a 'relocatable' installation (since the paths
are absolute) but that is not a regression on before.

 gdb/doc/Makefile.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 110b6088905..70ee9a8b9cb 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -429,10 +429,12 @@ GDBvn.texi : version.subst
 	  echo "@set SYSTEM_READLINE" >> ./GDBvn.new; \
 	fi
 	if [ -n "$(SYSTEM_GDBINIT)" ]; then \
-	  echo "@set SYSTEM_GDBINIT $(SYSTEM_GDBINIT)" >> ./GDBvn.new; \
+	  escaped_system_gdbinit=`echo $(SYSTEM_GDBINIT) | sed 's/@/@@/g'`; \
+	  echo "@set SYSTEM_GDBINIT $$escaped_system_gdbinit" >> ./GDBvn.new; \
 	fi
 	if [ -n "$(SYSTEM_GDBINIT_DIR)" ]; then \
-	  echo "@set SYSTEM_GDBINIT_DIR $(SYSTEM_GDBINIT_DIR)" >> ./GDBvn.new; \
+	  escaped_system_gdbinit_dir=`echo $(SYSTEM_GDBINIT_DIR) | sed 's/@/@@/g'`; \
+	  echo "@set SYSTEM_GDBINIT_DIR $$escaped_system_gdbinit_dir" >> ./GDBvn.new; \
 	fi
 	mv GDBvn.new GDBvn.texi
 
-- 
2.25.1


             reply	other threads:[~2023-11-29 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 15:14 Ciaran Woodward [this message]
2023-11-29 20:12 ` Tom Tromey
2023-12-01 16:55   ` Ciaran Woodward
2023-12-01 17:46     ` Tom Tromey

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=20231129151459.14738-1-ciaranwoodward@xmos.com \
    --to=ciaranwoodward@xmos.com \
    --cc=gdb-patches@sourceware.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).