]> wimlib.net Git - wimlib/blobdiff - src/ntfs-3g_capture.c
Add new helper function for ignoring scanned directory entries
[wimlib] / src / ntfs-3g_capture.c
index 1365c5036af902ef97a1dde43c555ba103e9f6be..de472327cec5df0d0f335a11afd87fea31d12d22 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++] = '/';
@@ -613,6 +609,7 @@ filldir(void *_ctx, const ntfschar *name, const int name_nchars,
                                                  ctx->volume, ctx->params);
        if (child)
                dentry_add_child(ctx->parent, child);
+out_free_mbs_name:
        FREE(mbs_name);
 out:
        ctx->ret = ret;