aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/driver/main.cc4
-rw-r--r--src/utils/command.cc6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/driver/main.cc b/src/driver/main.cc
index 686a48f2..3d8431b6 100644
--- a/src/driver/main.cc
+++ b/src/driver/main.cc
@@ -123,6 +123,8 @@ main(int argc, char* argv[])
Command command;
Driver driver = preprocess_arguments(&command, argc, argv);
upgrade_environment(&command);
+ oa_setenv("LC_ALL", "C");
+ setlocale(LC_ALL, "");
switch (driver) {
case Driver::null:
@@ -137,8 +139,6 @@ main(int argc, char* argv[])
case Driver::translator:
case Driver::linker:
case Driver::gui:
- oa_setenv("LC_ALL", "C");
- setlocale(LC_ALL, "");
return execute_core(&command, driver);
case Driver::execute:
diff --git a/src/utils/command.cc b/src/utils/command.cc
index f3517a8d..f007d517 100644
--- a/src/utils/command.cc
+++ b/src/utils/command.cc
@@ -447,9 +447,9 @@ preprocess_arguments(Command* command, int argc, char** argv)
// Return the total number of command-line arguments.
static int
args_count(const Command* cmd) {
- return cmd->core.argc > 0
- ? cmd->rt_args.size() + cmd->core.argc + 1
- : cmd->rt_args.size();
+ return cmd->core.argc > 1
+ ? cmd->rt_args.size() + cmd->core.argc + 2
+ : cmd->rt_args.size() + 1;
}
/* Execute the Core Executable as described by `command'. On