- write_ndx(f, NDX_FLIST_OFFSET - send_dir_ndx);
- change_local_filter_dir(fbuf, dlen, send_dir_depth);
- send_directory(f, flist, send_dir_ndx, fbuf, dlen,
- FLAG_DIVERT_DIRS | FLAG_XFER_DIR);
+#ifdef ICONV_OPTION
+ if (ic_ndx)
+ dir_ndx = F_NDX(file);
+ else
+#endif
+ dir_ndx = send_dir_ndx;
+ write_ndx(f, NDX_FLIST_OFFSET - dir_ndx);
+ flist->parent_ndx = dir_ndx;
+
+ send1extra(f, file, flist);
+ dp = F_DIR_NODE_P(file);
+
+ /* If there are any duplicate directory names that follow, we
+ * send all the dirs together in one file-list. The dir_flist
+ * tree links all the child subdirs onto the last dup dir. */
+ while ((dir_ndx = DIR_NEXT_SIBLING(dp)) >= 0
+ && dir_flist->sorted[dir_ndx]->flags & FLAG_DUPLICATE) {
+ send_dir_ndx = dir_ndx;
+ file = dir_flist->sorted[dir_ndx];
+ send1extra(f, file, flist);
+ dp = F_DIR_NODE_P(file);
+ }
+