This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFC/TESTSUITE] completion.exp
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 8 Apr 2003 19:29:01 -0400
- Subject: [RFC/TESTSUITE] completion.exp
Another one (I am going through the some RedHat Linux gdb patches, in
case it wasn't obvious). This one is fairly specific, I am not sure
if it would be Ok for inclusion in the general sources, but just in case.
Again this is for the '+' character in the directory name.
elena
* gdb.base/completion.exp: When matching on the current directory,
make sure that any '+' in the directory name gets escaped.
Index: completion.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.14
diff -u -p -r1.14 completion.exp
--- completion.exp 4 Jan 2003 22:37:49 -0000 1.14
+++ completion.exp 8 Apr 2003 23:18:00 -0000
@@ -669,7 +669,12 @@ cd ${srcdir}
set fullsrcdir [pwd]
cd ${mydir}
-gdb_test "cd ${fullsrcdir}" "Working directory ${fullsrcdir}.*" "cd to \${srcdir}"
+# If the directory name contains a '+' we must escape it, adding a backslash.
+# If not, the test below will fail because it will interpret the '+' as a
+# regext operator.
+regsub -all \\+ ${fullsrcdir} \\\+ dirstring
+
+gdb_test "cd ${fullsrcdir}" "Working directory ${dirstring}.*" "cd to \${srcdir}"
send_gdb "file ./gdb.base/compl\t"
sleep 1
gdb_expect {