[m-rev.] diff: MERCURY_OPTIONS_progname

Peter Wang novalazy at gmail.com
Mon Jul 14 11:17:38 AEST 2008

Branches: main

	Change program-specific options variable from MERCURY_OPTIONS-progname
	to MERCURY_OPTIONS_progname as the former is not a valid Bourne shell
	variable name.

	Update the documentation.

diff --git a/doc/user_guide.texi b/doc/user_guide.texi
index b531f66..d4a749c 100644
--- a/doc/user_guide.texi
+++ b/doc/user_guide.texi
@@ -9375,14 +9375,14 @@ A list of options for the Mercury runtime system,
 which gets linked into every Mercury program.
 The options given in this environment variable apply to every program;
 the options given in an environment variable
-whose name is of the form @samp{MERCURY_OPTIONS- at var{progname}}
+whose name is of the form @samp{MERCURY_OPTIONS_ at var{progname}}
 apply only to programs named @var{progname}.
 Options may also be set for a particular executable at compile time
 by passing @samp{--runtime-flags} options
 to the invocations of @samp{ml} and @samp{c2init} which create that executable.
 These options are processed first,
 followed by those in @samp{MERCURY_OPTIONS},
-with the options in @samp{MERCURY_OPTIONS- at var{progname}} being processed last.
+with the options in @samp{MERCURY_OPTIONS_ at var{progname}} being processed last.
 The Mercury runtime system accepts the following options.
diff --git a/runtime/mercury_wrapper.c b/runtime/mercury_wrapper.c
index 4784661..912e731 100644
--- a/runtime/mercury_wrapper.c
+++ b/runtime/mercury_wrapper.c
@@ -989,7 +989,7 @@ MR_process_args(int argc, char **argv)
 ** MR_process_environment_options() is a function to parse the options put
 ** into MR_runtime_flags by mkinit, the MERCURY_OPTIONS environment variable,
-** and the MERCURY_OPTIONS-progname environment variable.
+** and the MERCURY_OPTIONS_progname environment variable.
@@ -1019,12 +1019,12 @@ MR_process_environment_options(void)
-    /* Build the program-specific option's name: MERCURY_OPTIONS-progname. */
+    /* Build the program-specific option's name: MERCURY_OPTIONS_progname. */
     mercury_options_len = strlen(MERCURY_OPTIONS);
     prog_env_option_name_len = mercury_options_len + 1 + strlen(progname);
     prog_env_option_name = MR_GC_NEW_ARRAY(char, prog_env_option_name_len);
     strcpy(prog_env_option_name, MERCURY_OPTIONS);
-    prog_env_option_name[mercury_options_len] = '-';
+    prog_env_option_name[mercury_options_len] = '_';
     strcpy(prog_env_option_name + mercury_options_len + 1, progname);
     prog_env_options = getenv(prog_env_option_name);

mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au

More information about the reviews mailing list