This repository was archived by the owner on Nov 9, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 15
15
#include "log-tree.h"
16
16
#include "builtin.h"
17
17
#include "string-list.h"
18
+ #include "dir.h"
18
19
19
- static int read_directory (const char * path , struct string_list * list )
20
+ static int read_directory_contents (const char * path , struct string_list * list )
20
21
{
21
22
DIR * dir ;
22
23
struct dirent * e ;
@@ -25,7 +26,7 @@ static int read_directory(const char *path, struct string_list *list)
25
26
return error ("Could not open directory %s" , path );
26
27
27
28
while ((e = readdir (dir )))
28
- if (strcmp ( "." , e -> d_name ) && strcmp ( ".." , e -> d_name ))
29
+ if (! is_dot_or_dotdot ( e -> d_name ))
29
30
string_list_insert (list , e -> d_name );
30
31
31
32
closedir (dir );
@@ -107,9 +108,9 @@ static int queue_diff(struct diff_options *o,
107
108
int i1 , i2 , ret = 0 ;
108
109
size_t len1 = 0 , len2 = 0 ;
109
110
110
- if (name1 && read_directory (name1 , & p1 ))
111
+ if (name1 && read_directory_contents (name1 , & p1 ))
111
112
return -1 ;
112
- if (name2 && read_directory (name2 , & p2 )) {
113
+ if (name2 && read_directory_contents (name2 , & p2 )) {
113
114
string_list_clear (& p1 , 0 );
114
115
return -1 ;
115
116
}
You can’t perform that action at this time.
0 commit comments