From 6c561257b788d56fb25271abe7ad195d00b15b25 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 27 Nov 2016 15:24:34 -0800 Subject: [PATCH] ntfs-3g_apply.c: add message about another known libntfs-3g bug --- src/ntfs-3g_apply.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ntfs-3g_apply.c b/src/ntfs-3g_apply.c index b8b61296..3697b333 100644 --- a/src/ntfs-3g_apply.c +++ b/src/ntfs-3g_apply.c @@ -167,7 +167,7 @@ ntfs_3g_restore_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni, ret = -1; } utf16le_put_tstr(dos_name); - if (ret) { + if (unlikely(ret)) { int err = errno; ERROR_WITH_ERRNO("Failed to set DOS name of \"%s\" in NTFS " "volume", dentry_full_path(dentry)); @@ -179,6 +179,19 @@ ntfs_3g_restore_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni, "was fixed in the development version of " "NTFS-3G in June 2016."); } + if (err == EINVAL) { + utf16lechar c = + dentry->d_name[dentry->d_name_nbytes / 2 - 1]; + if (c == cpu_to_le16('.') || c == cpu_to_le16(' ')) { + ERROR("This error was probably caused by a " + "known bug in libntfs-3g where it is " + "unable to set DOS names on files whose " + "long names end with a dot or space " + "character. See " + "https://wimlib.net/forums/viewtopic.php?f=1&t=294 " + "for more information."); + } + } ret = WIMLIB_ERR_SET_SHORT_NAME; goto out_close; } -- 2.43.0