File tree 2 files changed +12
-1
lines changed 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 15
15
#include "win32/w32_util.h"
16
16
#include "win32/version.h"
17
17
#else
18
+ #include <fcntl.h>
18
19
#include <dirent.h>
20
+ #include <sys/stat.h>
21
+ #include <sys/types.h>
19
22
#endif
20
23
#include <stdio.h>
21
24
#include <ctype.h>
@@ -1398,6 +1401,8 @@ int git_path_diriter_next(git_path_diriter *diriter)
1398
1401
if (git_buf_oom (& diriter -> path ))
1399
1402
return -1 ;
1400
1403
1404
+ diriter -> d_type = de -> d_type ;
1405
+
1401
1406
return error ;
1402
1407
}
1403
1408
@@ -1429,9 +1434,14 @@ int git_path_diriter_fullpath(
1429
1434
1430
1435
int git_path_diriter_stat (struct stat * out , git_path_diriter * diriter )
1431
1436
{
1437
+ const char * fname ;
1438
+
1432
1439
assert (out && diriter );
1433
1440
1434
- return git_path_lstat (diriter -> path .ptr , out );
1441
+ fname = diriter -> path .ptr + diriter -> parent_len ;
1442
+ if (* fname == '/' ) ++ fname ;
1443
+
1444
+ return fstatat (dirfd (diriter -> dir ), fname , out , AT_SYMLINK_NOFOLLOW );
1435
1445
}
1436
1446
1437
1447
void git_path_diriter_free (git_path_diriter * diriter )
Original file line number Diff line number Diff line change @@ -482,6 +482,7 @@ struct git_path_diriter
482
482
{
483
483
git_buf path ;
484
484
size_t parent_len ;
485
+ unsigned char d_type ;
485
486
486
487
unsigned int flags ;
487
488
You can’t perform that action at this time.
0 commit comments