[m-rev.] for review: gdbrun bug fix
Zoltan Somogyi
zs at cs.mu.OZ.AU
Thu Apr 26 19:25:56 AEST 2001
For review by Fergus.
tools/gdbrun:
Fix a bug: quote the arguments properly.
Zoltan.
Index: gdbrun
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/gdbrun,v
retrieving revision 1.1
diff -u -b -r1.1 gdbrun
--- gdbrun 2001/01/18 01:19:29 1.1
+++ gdbrun 2001/04/26 09:19:08
@@ -12,6 +12,17 @@
tmpfile=/tmp/gdbrun.$$
trap "rm -f $tmpfile" 0 1 2 3 13 15
shift
-echo run "$@" > "$tmpfile"
+echo -n "run " > "$tmpfile"
+for arg in "$@"
+do
+ if echo "$arg" | grep " " > /dev/null
+ then
+ echo -n "\"$arg\" " >> $tmpfile
+ else
+ echo -n "$arg " >> $tmpfile
+ fi
+done
+echo >> $tmpfile
+
echo gdb --command="$tmpfile" $program
gdb --command="$tmpfile" $program
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list