This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING][PATCH] testsuite: Escape a loose '[' character inside a regexp.


On Tue, Jun 23, 2015 at 10:50 AM, Doug Evans <dje@google.com> wrote:
> Here the inconsistency happens because it turns out that
> in this context [ and \[ have the same effect.
> [I added some printfs to gdb_test to find this out.]
>
> I think that's a bug but I don't know what would be involved
> in fixing it.

Actually, this is arguably s.o.p. Bleah.
Otherwise \r\n inside {} won't get expanded as CR,LF.
E.g. compare
set foo {a\r\nb}
vs
set foo "a\r\nb"

That \[ gets expanded as [ is no different than \z getting expanded as z.
% set foo "a\zb\[c"
azb[c
%

Still a bit confusing since \[ vs [ different in most contexts in Tcl.
So I'd still advocate for a comment.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]