| line | true | false | branch | 
 
| 18 | 0 | 6587 | int (*statfn)(const char *, struct stat *) = (flags & B_FIND_FOLLOW_SYMLINKS)? stat: lstat; | 
 
| 31 | 0 | 87 | if ((dir = malloc(sizeof(*dir))) == NULL) { | 
 
| 35 | 0 | 87 | if ((dir->dp = opendir(path->str)) == NULL) { | 
 
| 39 | 0 | 87 | if ((dir->path = b_string_dup(path)) == NULL) { | 
 
| 56 | 87 | 0 | if (item->dp) { | 
 
| 62 | 0 | 87 | if (item == NULL) return; | 
 
| 85 | 87 | 299 | if ((entry = readdir(dir->dp)) == NULL) { | 
 
| 89 | 0 | 299 | if ((item = malloc(sizeof(*item))) == NULL) { | 
 
| 93 | 0 | 299 | if ((item->path = b_string_dup(dir->path)) == NULL) { | 
 
| 97 | 0 | 299 | if ((item->name = b_string_new(entry->d_name)) == NULL) { | 
 
| 104 | 299 | 0 | if (strcmp(item->path->str, "/") != 0) { | 
 
| 105 | 0 | 299 | if (b_string_append_str(item->path, "/") == NULL) { | 
 
| 110 | 0 | 299 | if (b_string_append_str(item->path, entry->d_name) == NULL) { | 
 
| 131 | 0 | 299 | if (item == NULL) return; | 
 
| 149 | 42 | 41 | if (strcmp(path->str, member_name->str) != 0) { | 
 
| 150 | 0 | 42 | if ((new_member_name = b_string_dup(member_name)) == NULL) { | 
 
| 154 | 0 | 42 | if (b_string_append_str(new_member_name, current->str + b_string_len(path)) == NULL) { | 
 
| 183 | 0 | 6587 | if (flags & B_FIND_FOLLOW_SYMLINKS) { | 
 
| 187 | 0 | 6587 | if ((clean_path = b_path_clean(path)) == NULL) { | 
 
| 191 | 0 | 6587 | if ((clean_member_name = b_path_clean(member_name)) == NULL) { | 
 
| 195 | 0 | 6587 | if ((dirs = b_stack_new(0)) == NULL) { | 
 
| 201 | 0 | 6587 | if (b_stat(clean_path, &st, flags) < 0) { | 
 
| 211 | 6556 | 31 | if ((st.st_mode & S_IFMT) == S_IFREG) { | 
 
| 212 | 0 | 6556 | if ((fd = open(clean_path->str, oflags)) < 0) { | 
 
| 215 | 0 | 6556 | if (fcntl(fd, F_SETFL, oflags & ~O_NONBLOCK))  // previously clear_nonblock, however we know oflags so we can do it outselves | 
 
| 221 | 6556 | 31 | if (fd > 0) { | 
 
| 226 | 0 | 6587 | if (res == 0) { | 
 
| 228 | 8 | 6579 | } else if (res < 0) { | 
 
| 232 | 6548 | 31 | if ((st.st_mode & S_IFMT) != S_IFDIR) { | 
 
| 236 | 0 | 31 | if ((dir = b_dir_open(clean_path)) == NULL) { | 
 
| 237 | 0 | 0 | if (err) { | 
 
| 244 | 0 | 31 | if (b_stack_push(dirs, dir) == NULL) { | 
 
| 256 | 31 | 386 | if (cwd == NULL) { | 
 
| 260 | 87 | 299 | if ((item = b_dir_read(cwd, flags)) == NULL) { | 
 
| 263 | 87 | 0 | if (oldcwd) { | 
 
| 270 | 212 | 87 | if (strcmp(item->name->str, ".") == 0 || strcmp(item->name->str, "..") == 0) { | 
 
|  | 125 | 87 | if (strcmp(item->name->str, ".") == 0 || strcmp(item->name->str, "..") == 0) { | 
 
| 279 | 119 | 6 | if (builder->match != NULL && lafe_excluded(builder->match, (const char *)item->path->str)) { | 
 
|  | 42 | 77 | if (builder->match != NULL && lafe_excluded(builder->match, (const char *)item->path->str)) { | 
 
| 283 | 0 | 83 | if ((item_fd = open(item->path->str, oflags)) < 0) { | 
 
| 297 | 0 | 0 | if ((oflags & O_NOFOLLOW) && (errno == ELOOP || errno == EMLINK || errno == EFTYPE)) { | 
 
|  | 0 | 0 | if ((oflags & O_NOFOLLOW) && (errno == ELOOP || errno == EMLINK || errno == EFTYPE)) { | 
 
|  | 0 | 0 | if ((oflags & O_NOFOLLOW) && (errno == ELOOP || errno == EMLINK || errno == EFTYPE)) { | 
 
|  | 0 | 0 | if ((oflags & O_NOFOLLOW) && (errno == ELOOP || errno == EMLINK || errno == EFTYPE)) { | 
 
| 298 | 0 | 0 | if (lstat(item->path->str, &item_st) < 0) { | 
 
| 299 | 0 | 0 | if (err) { | 
 
| 306 | 0 | 0 | if( flags & B_FIND_IGNORE_SOCKETS ) { | 
 
| 307 | 0 | 0 | if (stat(item->path->str, &item_st) < 0) { | 
 
| 308 | 0 | 0 | if (err) { | 
 
| 313 | 0 | 0 | if( err && (item_st.st_mode & S_IFMT) != S_IFSOCK ) { | 
 
|  | 0 | 0 | if( err && (item_st.st_mode & S_IFMT) != S_IFSOCK ) { | 
 
| 319 | 0 | 0 | if (err) { | 
 
| 327 | 0 | 83 | if (fcntl(fd, F_SETFL, oflags & ~O_NONBLOCK)) // previously clear_nonblock, however we know oflags so we can do it outselves | 
 
| 329 | 0 | 83 | if (fstat(item_fd, &item_st) < 0) { | 
 
| 330 | 0 | 0 | if (err) { | 
 
| 344 | 41 | 42 | res = callback(builder, item->path, new_member_name? new_member_name: item->path, &item_st, item_fd); | 
 
| 348 | 0 | 83 | if (res == 0) { | 
 
| 350 | 0 | 83 | } else if (res < 0) { | 
 
| 351 | 0 | 0 | if (err && !b_error_fatal(err)) { | 
 
|  | 0 | 0 | if (err && !b_error_fatal(err)) { | 
 
| 358 | 56 | 27 | if ((item_st.st_mode & S_IFMT) == S_IFDIR) { | 
 
| 361 | 0 | 56 | if ((newdir = b_dir_open(item->path)) == NULL) { | 
 
| 362 | 0 | 0 | if (err) { | 
 
| 366 | 0 | 0 | if (errno == EACCES) { | 
 
| 373 | 0 | 56 | if (b_stack_push(dirs, newdir) == NULL) { | 
 
| 381 | 83 | 216 | if (item_fd > 0) { | 
 
| 391 | 0 | 0 | if (item_fd > 0) { | 
 
| 412 | 0 | 8 | if (fd > 0) { |