Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1498,8 +1498,8 @@ static void general_file_transfer(int transfer_type, int append)
strcat(dest_filespec, d_extspec);
conv_unix_path_to_ms_dos(dest_filespec);

if (has_wildcard(dest_filespec))
expand_wildcard(dest_filespec, s_filespec, s_extspec + 1);
/* A wildcard in dest_filespec (e.g. *.* or *.bak) is expanded below,
* against each file that the source spec matches. */
if (has_wildcard(dest_path))
{
cputs("Illegal wildcard on destination\r\n");
Expand Down Expand Up @@ -1588,8 +1588,19 @@ static void general_file_transfer(int transfer_type, int append)
strcat(full_dest_dirspec, dir_name[s]);
}
strcat(full_source_filespec, FINDDATA_T_FILENAME(ff[subdir_level]));
if (strcmp(dest_filespec, "*.*") == 0)
strcat(full_dest_filespec, FINDDATA_T_FILENAME(ff[subdir_level]));
if (has_wildcard(dest_filespec))
{
/* fill the wildcards of dest from the name of the file found */
char found_name[MAXFILE], found_ext[MAXEXT];
char dest_name[MAXPATH];

fnsplit(FINDDATA_T_FILENAME(ff[subdir_level]), NULL, NULL,
found_name, found_ext);
strcpy(dest_name, dest_filespec);
expand_wildcard(dest_name, found_name,
found_ext[0] == '.' ? found_ext + 1 : found_ext);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this condition is needed?
found_ext can have various forms?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given it doesn't seem to fully solve the issue, I'm a bit sus on its solution and will go and read the code.

The funny thing is, it implemented follow up branches that actually get bin and cue working though I need to eyeball those and this of course.

strcat(full_dest_filespec, dest_name);
}
else
strcat(full_dest_filespec, dest_filespec);

Expand Down