[gdb/doc] Escape the '@' symbols in generated texinfo files.

Message ID 20231129151459.14738-1-ciaranwoodward@xmos.com
State Committed
Headers
Series [gdb/doc] Escape the '@' symbols in generated texinfo files. |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Ciaran Woodward Nov. 29, 2023, 3:14 p.m. UTC
  '@' 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(-)
  

Comments

Tom Tromey Nov. 29, 2023, 8:12 p.m. UTC | #1
>>>>> Ciaran Woodward <ciaranwoodward@xmos.com> writes:

> '@' 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.

Thank you.  This patch is ok.

Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Ciaran Woodward Dec. 1, 2023, 4:55 p.m. UTC | #2
> Thank you.  This patch is ok.
> 
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom

Thanks for approving - please could you push it for me?

I sent you an email privately about moving ahead with
write-after-approval access (I have completed the
copyright assignment process), but I guess it might
have been eaten by spam filters?

Thanks,
Ciaran
  
Tom Tromey Dec. 1, 2023, 5:46 p.m. UTC | #3
Ciaran> I sent you an email privately about moving ahead with
Ciaran> write-after-approval access (I have completed the
Ciaran> copyright assignment process), but I guess it might
Ciaran> have been eaten by spam filters?

It's just me being behind on email.
I will send you some info off list.

Tom
  

Patch

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