Skip to content

Commit

Permalink
cloud sync: fix windows path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
warmenhoven committed Jan 9, 2025
1 parent 74e7a62 commit 63b300d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tasks/task_cloudsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ static void task_cloud_sync_backup_file(struct item_file *file)
CS_FILE_KEY(file),
sizeof(new_path));
strftime(new_path + len, sizeof(new_path) - len, "-%y%m%d-%H%M%S", &tm_);
pathname_conform_slashes_to_os(new_path);
fill_pathname_basedir(new_dir, new_path, sizeof(new_dir));
path_mkdir(new_dir);
filestream_rename(file->path, new_path);
Expand Down Expand Up @@ -583,7 +584,8 @@ static void task_cloud_sync_fetch_server_file(task_cloud_sync_state_t *sync_stat
struct string_list *dirlist = task_cloud_sync_directory_map();
struct item_file *server_file = &sync_state->server_manifest->list[sync_state->server_idx];
const char *key = CS_FILE_KEY(server_file);
const char *path = strchr(key, PATH_DEFAULT_SLASH_C()) + 1;
/* the key from the server file is in "portable" format, use '/' */
const char *path = strchr(key, '/') + 1;
settings_t *settings = config_get_ptr();

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

0 comments on commit 63b300d

Please sign in to comment.