1
0
Fork 0
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:
Jonas 'Sortie' Termansen 2014-12-04 18:10:30 +01:00
parent 3917f4fee3
commit 99f27d5eb1

View file

@ -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;
}