mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-27 06:27:57 +00:00
(log_working_directory): Made global.
Print entering msg only once.
This commit is contained in:
parent
808f1c1cd2
commit
37cf6fdc18
1 changed files with 18 additions and 24 deletions
18
main.c
18
main.c
|
@ -43,7 +43,6 @@ extern double atof ();
|
|||
#endif
|
||||
extern char *mktemp ();
|
||||
|
||||
static void log_working_directory ();
|
||||
static void print_data_base (), print_version ();
|
||||
static void decode_switches (), decode_env_switches ();
|
||||
static void define_makeflags ();
|
||||
|
@ -688,10 +687,6 @@ main (argc, argv, envp)
|
|||
starting_directory = current_directory;
|
||||
}
|
||||
|
||||
/* Tell the user where he is. */
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (1);
|
||||
|
||||
/* Read any stdin makefiles into temporary files. */
|
||||
|
||||
|
@ -1010,7 +1005,6 @@ main (argc, argv, envp)
|
|||
if (print_data_base_flag)
|
||||
print_data_base ();
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (0);
|
||||
|
||||
if (makefiles != 0)
|
||||
|
@ -1950,7 +1944,6 @@ die (status)
|
|||
if (print_data_base_flag)
|
||||
print_data_base ();
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (0);
|
||||
}
|
||||
|
||||
|
@ -1960,20 +1953,21 @@ die (status)
|
|||
/* Write a message indicating that we've just entered or
|
||||
left (according to ENTERING) the current directory. */
|
||||
|
||||
static void
|
||||
void
|
||||
log_working_directory (entering)
|
||||
int entering;
|
||||
{
|
||||
static int entered = 0;
|
||||
char *message = entering ? "Entering" : "Leaving";
|
||||
|
||||
if (entering)
|
||||
entered = 1;
|
||||
else if (!entered)
|
||||
/* Don't print the leaving message if we
|
||||
/* Print nothing without the flag. Don't print the entering message
|
||||
again if we already have. Don't print the leaving message if we
|
||||
haven't printed the entering message. */
|
||||
if (! print_directory_flag || entering == entered)
|
||||
return;
|
||||
|
||||
entered = entering;
|
||||
|
||||
if (print_data_base_flag)
|
||||
fputs ("# ", stdout);
|
||||
|
||||
|
|
Loading…
Reference in a new issue