X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwildcard.c;h=234ee91ce72d3eadb6fefc68caf4d654741116c4;hp=2619f47b59fe445f84d2e31012d2e6f90828464e;hb=ced16a28e197645a40fa04a54793d117a04526d7;hpb=5ede6282b6f28fcd71d6eb556dae69e83d925e11 diff --git a/src/wildcard.c b/src/wildcard.c index 2619f47b..234ee91c 100644 --- a/src/wildcard.c +++ b/src/wildcard.c @@ -188,23 +188,18 @@ wildcard_status(const tchar *wildcard) static int match_dentry(struct wim_dentry *cur_dentry, struct match_dentry_ctx *ctx) { - tchar *name; + const tchar *name; size_t name_len; int ret; if (cur_dentry->file_name_nbytes == 0) return 0; -#if TCHAR_IS_UTF16LE - name = cur_dentry->file_name; - name_len = cur_dentry->file_name_nbytes; -#else - ret = utf16le_to_tstr(cur_dentry->file_name, - cur_dentry->file_name_nbytes, - &name, &name_len); + ret = utf16le_get_tstr(cur_dentry->file_name, + cur_dentry->file_name_nbytes, + &name, &name_len); if (ret) return ret; -#endif name_len /= sizeof(tchar); if (match_wildcard(name, @@ -235,9 +230,8 @@ match_dentry(struct wim_dentry *cur_dentry, struct match_dentry_ctx *ctx) ret = 0; } -#if !TCHAR_IS_UTF16LE - FREE(name); -#endif + utf16le_put_tstr(name); + return ret; }