mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Removed reliance on dirfd()
This commit is contained in:
parent
aef88fb773
commit
a0bf6deebb
3 changed files with 2 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
|||
git - ?
|
||||
- Implemented hard link detection
|
||||
- Properly select the next item after deletion
|
||||
- Removed reliance of dirfd()
|
||||
|
||||
1.5 - 2009-05-02
|
||||
- Fixed incorrect apparent size on directory refresh
|
||||
|
|
|
|||
|
|
@ -198,18 +198,13 @@ path_real_done:
|
|||
char *path_real(const char *orig) {
|
||||
int links = 0;
|
||||
char *tmp, *ret;
|
||||
DIR *d;
|
||||
|
||||
if(orig == NULL)
|
||||
return NULL;
|
||||
if((d = opendir(".")) == NULL)
|
||||
return NULL;
|
||||
|
||||
tmp = path_absolute(orig);
|
||||
ret = path_real_rec(tmp, &links);
|
||||
free(tmp);
|
||||
fchdir(dirfd(d));
|
||||
closedir(d);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
- Potentionally slow
|
||||
- Doesn't check return value of malloc() and realloc()
|
||||
- path_real doesn't check for the existance of the last component
|
||||
- cwd is unreliable after path_real
|
||||
*/
|
||||
|
||||
#ifndef _path_h
|
||||
|
|
|
|||
Loading…
Reference in a new issue