aboutsummaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-06-13 08:38:27 +0000
committerdos-reis <gdr@axiomatics.org>2009-06-13 08:38:27 +0000
commit25a89d045fc97f375610f3567af4207baf96a87c (patch)
tree35a82a14731553818b40b5934c4b1dff91b7509d /src/driver
parent3e18a71ba4d8c6b12ed0d9de89ca420097ec3d94 (diff)
downloadopen-axiom-25a89d045fc97f375610f3567af4207baf96a87c.tar.gz
* driver/utils.c (openaxiom_execute_core): Workaround GCL oddity.
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/utils.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/driver/utils.c b/src/driver/utils.c
index e817dcd4..1bf2eccc 100644
--- a/src/driver/utils.c
+++ b/src/driver/utils.c
@@ -373,12 +373,24 @@ openaxiom_execute_core(const openaxiom_command* command,
int i;
char** args = (char**)
malloc(sizeof (char*) * (command->rt_argc + command->core_argc + 2));
- args[0] = command->core_argv[0];
+ /* GCL has this oddity that it wants to believe that argv[0] has
+ something to tell about what GCL's own runtime is. Silly. */
+ if (OPENAXIOM_BASE_RTS == openaxiom_gcl_runtime)
+ args[0] = "";
+ else
+ args[0] = command->core_argv[0];
+ /* Now, make sure we copy whatever arguments are required by the
+ runtime system. */
for (i = 0; i < command->rt_argc; ++i)
args[i + 1] = command->rt_argv[i];
+
if (command->core_argc > 1) {
- /* Insert a doubledash to indicate beginning of arguments. */
+ /* We do have arguments from the command line. We want to
+ differentiate this from the base runtime system arguments.
+ We do this by inserting a doubledash to indicate beginning
+ of arguments. */
args[command->rt_argc + 1] = "--";
+ /* Then, copy over the arguments received from the command line. */
for (i = 1; i < command->core_argc; ++i)
args[command->rt_argc + i + 1] = command->core_argv[i];
args[command->rt_argc + command->core_argc + 1] = NULL;