]> wimlib.net Git - wimlib/blobdiff - src/ntfs-3g_capture.c
Add new helper function for attaching newly scanned dentry tree
[wimlib] / src / ntfs-3g_capture.c
index 1365c5036af902ef97a1dde43c555ba103e9f6be..439d17a61aa98c7931b9b59646427f62aa72ac6d 100644 (file)
@@ -591,17 +591,13 @@ filldir(void *_ctx, const ntfschar *name, const int name_nchars,
                        goto out;
        }
 
-       /* Ignore . and .. entries  */
-       ret = 0;
-       if ((name_nchars == 1 && name[0] == cpu_to_le16('.')) ||
-           (name_nchars == 2 && name[0] == cpu_to_le16('.') &&
-                                name[1] == cpu_to_le16('.')))
-               goto out;
-
        ret = utf16le_to_tstr(name, name_nbytes, &mbs_name, &mbs_name_nbytes);
        if (ret)
                goto out;
 
+       if (should_ignore_filename(mbs_name, mbs_name_nbytes))
+               goto out_free_mbs_name;
+
        path_len = ctx->path_len;
        if (path_len != 1)
                ctx->path[path_len++] = '/';
@@ -611,8 +607,8 @@ filldir(void *_ctx, const ntfschar *name, const int name_nchars,
        ret = ntfs_3g_build_dentry_tree_recursive(&child, mref, ctx->path,
                                                  path_len, name_type,
                                                  ctx->volume, ctx->params);
-       if (child)
-               dentry_add_child(ctx->parent, child);
+       attach_scanned_tree(ctx->parent, child, ctx->params->blob_table);
+out_free_mbs_name:
        FREE(mbs_name);
 out:
        ctx->ret = ret;