- if (stream_name_nchars &&
- (ntfs_attr_add(ni, AT_DATA, strm->stream_name,
- stream_name_nchars, NULL, 0)))
- {
- ERROR_WITH_ERRNO("Failed to create named data stream of \"%s\"",
- dentry_full_path(one_dentry));
- return WIMLIB_ERR_NTFS_3G;
+ if (ntfs_attr_add(ni, AT_DATA, stream_name,
+ stream_name_nchars, NULL, 0))
+ {
+ ERROR_WITH_ERRNO("Failed to create named data stream of \"%s\"",
+ dentry_full_path(one_dentry));
+ return WIMLIB_ERR_NTFS_3G;
+ }
+ } else {
+ /* Don't pass an empty string other than AT_UNNAMED to
+ * ntfs_attr_open() --- it violates assumptions made by
+ * libntfs-3g. */
+ stream_name = AT_UNNAMED;
+ stream_name_nchars = 0;