clipboard file paste, don't add new line to last line

ulab-next-nosound
Jay Sorg 10 years ago
parent 4a6567c5a2
commit 9e310fbe06

@ -626,6 +626,7 @@ clipboard_c2s_in_files(struct stream *s, char *file_list)
int cItems;
int lindex;
int str_len;
int file_count;
struct clip_file_desc *cfd;
char *ptr;
@ -644,6 +645,7 @@ clipboard_c2s_in_files(struct stream *s, char *file_list)
log_debug("clipboard_c2s_in_files: cItems %d", cItems);
cfd = (struct clip_file_desc *)
g_malloc(sizeof(struct clip_file_desc), 0);
file_count = 0;
ptr = file_list;
for (lindex = 0; lindex < cItems; lindex++)
{
@ -658,6 +660,13 @@ clipboard_c2s_in_files(struct stream *s, char *file_list)
}
xfuse_add_clip_dir_item(cfd->cFileName, 0, cfd->fileSizeLow, lindex);
if (file_count > 0)
{
*ptr = '\n';
ptr++;
}
file_count++;
g_strcpy(ptr, "file://");
ptr += 7;
@ -671,9 +680,6 @@ clipboard_c2s_in_files(struct stream *s, char *file_list)
str_len = g_strlen(cfd->cFileName);
g_strcpy(ptr, cfd->cFileName);
ptr += str_len;
*ptr = '\n';
ptr++;
}
*ptr = 0;
g_free(cfd);

Loading…
Cancel
Save