From: Eric Biggers Date: Sat, 25 Jun 2016 00:41:24 +0000 (-0500) Subject: unix_capture.c: add error messages for invalid UTF-8 X-Git-Tag: v1.10.0~45 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=7453f4a4245219a9c01a70902283f6ebb2a65123 unix_capture.c: add error messages for invalid UTF-8 --- diff --git a/src/unix_capture.c b/src/unix_capture.c index a909f45b..eed38f62 100644 --- a/src/unix_capture.c +++ b/src/unix_capture.c @@ -320,8 +320,13 @@ unix_scan_symlink(const char *full_path, int dirfd, const char *relpath, /* Translate the UNIX symlink target into a Windows reparse point. */ ret = wim_inode_set_symlink(inode, target, params->blob_table); - if (ret) + if (unlikely(ret)) { + if (ret == WIMLIB_ERR_INVALID_UTF8_STRING) { + ERROR("\"%s\": target of symbolic link is not valid " + "UTF-8. This is not supported.", full_path); + } return ret; + } /* On Windows, a reparse point can be set on both directory and * non-directory files. Usually, a link that is intended to point to a @@ -389,8 +394,13 @@ unix_build_dentry_tree_recursive(struct wim_dentry **tree_ret, ret = inode_table_new_dentry(params->inode_table, relpath, stbuf.st_ino, stbuf.st_dev, false, &tree); - if (ret) + if (unlikely(ret)) { + if (ret == WIMLIB_ERR_INVALID_UTF8_STRING) { + ERROR("\"%s\": filename is not valid UTF-8. " + "This is not supported.", full_path); + } goto out; + } inode = tree->d_inode;