Re: [patch] Fix crash on CLI indented comments [Re: [Bug:cli] Loading user-defined function generates an internal error]

Jan Kratochvil
2010-01-01T11:01:49Z

On Fri, 01 Jan 2010 11:35:20 +0100, Joel Brobecker wrote:
> Approved. Thanks for fixing.

Checked-in.

> Test indented comment in file being sourced.
> * commands.exp: Test indented comment in file being sourced.

OK, thanks for this work.

Regards,
Jan

http://sourceware.org/ml/gdb-cvs/2010-01/msg00014.html

--- src/gdb/ChangeLog 2010/01/01 09:44:05 1.11190
+++ src/gdb/ChangeLog 2010/01/01 10:57:42 1.11191
@@ -1,3 +1,7 @@
+2010-01-01 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * cli/cli-script.c (process_next_line): Check P2 overrun.
+
2009-01-01 Joel Brobecker <brobecker@adacore.com>

Update the copyright hearder to add year 2010 for most GDB files.
--- src/gdb/cli/cli-script.c 2010/01/01 07:31:47 1.55
+++ src/gdb/cli/cli-script.c 2010/01/01 10:57:43 1.56
@@ -893,7 +893,7 @@

p2 = p;
/* Strip leading whitespace. */
- while (*p2 == ' ' || *p2 == '\t')
+ while (p2 != p1 && (*p2 == ' ' || *p2 == '\t'))
p2++;

/* 'end' is always recognized, regardless of parse_commands value.