- char prev_name[MAXPATHLEN], altbuf[MAXPATHLEN], *realname;
- int alt_dest, prev_ndx = F_HL_PREV(file);
- struct file_struct *prev_file = FPTR(prev_ndx);
-
- /* Is the previous link is not complete yet? */
- if (!(prev_file->flags & FLAG_HLINK_DONE)) {
- /* Is the previous link being transferred? */
- if (prev_file->flags & FLAG_SENT) {
- /* Add ourselves to the list of files that will be
- * updated when the transfer completes, and mark
- * ourself as waiting for the transfer. */
- F_HL_PREV(file) = F_HL_PREV(prev_file);
- F_HL_PREV(prev_file) = ndx;
- file->flags |= FLAG_SENT;
- return 1;
+ char namebuf[MAXPATHLEN], altbuf[MAXPATHLEN];
+ char *realname, *prev_name;
+ struct file_list *flist;
+ int gnum = inc_recurse ? F_HL_GNUM(file) : -1;
+ int prev_ndx = F_HL_PREV(file);
+
+ prev_name = realname = check_prior(prev_ndx, gnum, &flist);
+
+ if (!prev_name) {
+ struct file_struct *prev_file = flist->files[prev_ndx - flist->ndx_start];
+
+ /* Is the previous link is not complete yet? */
+ if (!(prev_file->flags & FLAG_HLINK_DONE)) {
+ /* Is the previous link being transferred? */
+ if (prev_file->flags & FLAG_FILE_SENT) {
+ /* Add ourselves to the list of files that will be
+ * updated when the transfer completes, and mark
+ * ourself as waiting for the transfer. */
+ F_HL_PREV(file) = F_HL_PREV(prev_file);
+ F_HL_PREV(prev_file) = ndx;
+ file->flags |= FLAG_FILE_SENT;
+ cur_flist->in_progress++;
+ return 1;
+ }
+ return 0;