mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-12-27 23:06:53 +00:00
Formerly main.c.~73~
This commit is contained in:
parent
7c675f86e6
commit
d5ef06dee5
1 changed files with 7 additions and 2 deletions
9
main.c
9
main.c
|
@ -373,6 +373,7 @@ main (argc, argv, envp)
|
|||
register struct dep *lastgoal;
|
||||
struct dep *read_makefiles;
|
||||
PATH_VAR (current_directory);
|
||||
char *directory_before_chdir;
|
||||
|
||||
default_goal_file = 0;
|
||||
reading_filename = 0;
|
||||
|
@ -461,7 +462,11 @@ main (argc, argv, envp)
|
|||
error ("getwd: %s", current_directory);
|
||||
#endif
|
||||
current_directory[0] = '\0';
|
||||
directory_before_chdir = 0;
|
||||
}
|
||||
else
|
||||
directory_before_chdir = savestring (current_directory,
|
||||
strlen (current_directory));
|
||||
|
||||
/* Read in variables from the environment. It is important that this be
|
||||
done before `MAKE' and `MAKEOVERRIDES' are figured out so their
|
||||
|
@ -939,9 +944,9 @@ main (argc, argv, envp)
|
|||
if (directories != 0 && directories->idx > 0)
|
||||
{
|
||||
char bad;
|
||||
if (current_directory[0] != '\0')
|
||||
if (directory_before_chdir != 0)
|
||||
{
|
||||
if (chdir (current_directory) < 0)
|
||||
if (chdir (directory_before_chdir) < 0)
|
||||
{
|
||||
perror_with_name ("chdir", "");
|
||||
bad = 1;
|
||||
|
|
Loading…
Reference in a new issue