]> wimlib.net Git - wimlib/commitdiff
ntfs-3g_apply.c: add message about another known libntfs-3g bug
authorEric Biggers <ebiggers3@gmail.com>
Sun, 27 Nov 2016 23:24:34 +0000 (15:24 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 27 Nov 2016 23:24:34 +0000 (15:24 -0800)
src/ntfs-3g_apply.c

index b8b612967ed40e522d12b3cb400bd4b363bce2e0..3697b333d4c5b61c33a290e80cb59e7ca7fbb78d 100644 (file)
@@ -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;
        }