Skip to content
Snippets Groups Projects
Commit a0bf6dee authored by Yorhel's avatar Yorhel
Browse files

Removed reliance on dirfd()

parent aef88fb7
No related branches found
No related tags found
No related merge requests found
git - ? git - ?
- Implemented hard link detection - Implemented hard link detection
- Properly select the next item after deletion - Properly select the next item after deletion
- Removed reliance of dirfd()
1.5 - 2009-05-02 1.5 - 2009-05-02
- Fixed incorrect apparent size on directory refresh - Fixed incorrect apparent size on directory refresh
......
...@@ -198,18 +198,13 @@ path_real_done: ...@@ -198,18 +198,13 @@ path_real_done:
char *path_real(const char *orig) { char *path_real(const char *orig) {
int links = 0; int links = 0;
char *tmp, *ret; char *tmp, *ret;
DIR *d;
if(orig == NULL) if(orig == NULL)
return NULL; return NULL;
if((d = opendir(".")) == NULL)
return NULL;
tmp = path_absolute(orig); tmp = path_absolute(orig);
ret = path_real_rec(tmp, &links); ret = path_real_rec(tmp, &links);
free(tmp); free(tmp);
fchdir(dirfd(d));
closedir(d);
return ret; return ret;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
- Potentionally slow - Potentionally slow
- Doesn't check return value of malloc() and realloc() - Doesn't check return value of malloc() and realloc()
- path_real doesn't check for the existance of the last component - path_real doesn't check for the existance of the last component
- cwd is unreliable after path_real
*/ */
#ifndef _path_h #ifndef _path_h
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment