mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix pwd(1) unsetting PWD and exit code.
This commit is contained in:
parent
3917f4fee3
commit
99f27d5eb1
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
|
@ -123,7 +123,7 @@ int main(int argc, char* argv[])
|
|||
if ( const char* pwd = getenv("PWD") )
|
||||
{
|
||||
if ( physical || !is_path_absolute(pwd) )
|
||||
unsetenv(pwd);
|
||||
unsetenv("PWD");
|
||||
}
|
||||
|
||||
char* pwd = get_current_dir_name();
|
||||
|
@ -132,5 +132,8 @@ int main(int argc, char* argv[])
|
|||
|
||||
printf("%s\n", pwd);
|
||||
|
||||
if ( ferror(stdout) || fflush(stdout) == EOF )
|
||||
error(1, errno, "stdout");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue