[m-rev.] for review: set runtime flags at compile time

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 21 17:18:05 AEDT 2002


On 12-Jan-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Allow Mercury runtime options to be set at compile time.
...
> --- util/mkinit.c	18 Dec 2001 05:44:13 -0000	1.80
...
> +	printf("	MR_runtime_flags = \"");
> +	for (list_tmp = runtime_flags;
> +			list_tmp != NULL; list_tmp = list_tmp->next) {
> +		fputs(list_tmp->data, stdout);

Using fputs() here is wrong.  Any special characters --
in particular '\"', '\\' and '\n' -- need to be quoted.

This may be particularly important in this case of run-time options
which are file names when using DOS/Windows, since they are quite
likely to include \\.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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