summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-02-10 00:10:57 +0000
committerPaul Smith <psmith@gnu.org>2005-02-10 00:10:57 +0000
commitc90f47e8320b41e3a5bfeb654543d9474f763e5d (patch)
treef1e18c8945deebecf1529c040d01602d9c997eaa /main.c
parent939167cfc151eae77c0d2a9d01fe2e73cab1a1b1 (diff)
downloadgunmake-c90f47e8320b41e3a5bfeb654543d9474f763e5d.tar.gz
Flush stdout after printing directory info.
Fix references to MINGW #define constants. Remove WINDOWS32 ifdef from sub_proc.h. Only add variables to the command line for recursion once. New features in run_make_test: #PWD# and #MAKEPATH# replacements. Test the multi-variable fix in the recursion regression test.
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/main.c b/main.c
index 1086908..726729b 100644
--- a/main.c
+++ b/main.c
@@ -2150,13 +2150,21 @@ handle_non_switch_argument (char *arg, int env)
v = try_variable_definition (0, arg, o_command, 0);
if (v != 0)
{
- /* It is indeed a variable definition. Record a pointer to
- the variable for later use in define_makeflags. */
- struct command_variable *cv
- = (struct command_variable *) xmalloc (sizeof (*cv));
- cv->variable = v;
- cv->next = command_variables;
- command_variables = cv;
+ /* It is indeed a variable definition. If we don't already have this
+ one, record a pointer to the variable for later use in
+ define_makeflags. */
+ struct command_variable *cv;
+
+ for (cv = command_variables; cv != 0; cv = cv->next)
+ if (cv->variable == v)
+ break;
+
+ if (! cv) {
+ cv = (struct command_variable *) xmalloc (sizeof (*cv));
+ cv->variable = v;
+ cv->next = command_variables;
+ command_variables = cv;
+ }
}
else if (! env)
{
@@ -2907,4 +2915,7 @@ log_working_directory (int entering)
else
printf (_("%s[%u]: Leaving directory `%s'\n"),
program, makelevel, starting_directory);
+
+ /* Flush stdout to be sure this comes before any stderr output. */
+ fflush (stdout);
}