Skip to content

Commit 63b300d

Browse files
committed
cloud sync: fix windows path issues
1 parent 74e7a62 commit 63b300d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tasks/task_cloudsync.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ static void task_cloud_sync_backup_file(struct item_file *file)
539539
CS_FILE_KEY(file),
540540
sizeof(new_path));
541541
strftime(new_path + len, sizeof(new_path) - len, "-%y%m%d-%H%M%S", &tm_);
542+
pathname_conform_slashes_to_os(new_path);
542543
fill_pathname_basedir(new_dir, new_path, sizeof(new_dir));
543544
path_mkdir(new_dir);
544545
filestream_rename(file->path, new_path);
@@ -583,7 +584,8 @@ static void task_cloud_sync_fetch_server_file(task_cloud_sync_state_t *sync_stat
583584
struct string_list *dirlist = task_cloud_sync_directory_map();
584585
struct item_file *server_file = &sync_state->server_manifest->list[sync_state->server_idx];
585586
const char *key = CS_FILE_KEY(server_file);
586-
const char *path = strchr(key, PATH_DEFAULT_SLASH_C()) + 1;
587+
/* the key from the server file is in "portable" format, use '/' */
588+
const char *path = strchr(key, '/') + 1;
587589
settings_t *settings = config_get_ptr();
588590

589591
/* we're just fetching a file the server has, we can update this now */
@@ -604,6 +606,7 @@ static void task_cloud_sync_fetch_server_file(task_cloud_sync_state_t *sync_stat
604606
if (!string_starts_with(key, dirlist->elems[i].data))
605607
continue;
606608
fill_pathname_join_special(filename, dirlist->elems[i].userdata, path, sizeof(filename));
609+
pathname_conform_slashes_to_os(filename);
607610
break;
608611
}
609612
if (string_is_empty(filename))

0 commit comments

Comments
 (0)