X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fntfs-3g_capture.c;h=de472327cec5df0d0f335a11afd87fea31d12d22;hb=b87b3beaacd32c045ab77dc56c6b90677d882830;hp=1365c5036af902ef97a1dde43c555ba103e9f6be;hpb=0497587f1cf98171731480a0444624eb47a8560a;p=wimlib diff --git a/src/ntfs-3g_capture.c b/src/ntfs-3g_capture.c index 1365c503..de472327 100644 --- a/src/ntfs-3g_capture.c +++ b/src/ntfs-3g_capture.c @@ -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;