Skip to content

Commit

Permalink
fixed cache system for percentage encoded file in single-file mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fangfufu committed May 5, 2024
1 parent 28293b5 commit 720db5a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,7 @@ int Cache_create(const char *path)
Link *this_link = path_to_Link(path);

char *fn = "__UNINITIALISED__";
/*
* TODO: Warning: curl_easy_unescape breaks cache creation
*/

if (CONFIG.mode == NORMAL) {
fn = curl_easy_unescape(NULL,
this_link->f_url + ROOT_LINK_OFFSET, 0,
Expand Down
4 changes: 0 additions & 4 deletions src/fuse_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ static int fs_open(const char *path, struct fuse_file_info *fi)
/*
* The cache definitely cannot be opened for some reason.
*/
/*
* TODO: This appears to be broken when the file needs to be
* percentage encoded
*/
if (!fi->fh) {
lprintf(fatal, "Cache file creation failure for %s.\n", path);
return -ENOENT;
Expand Down
3 changes: 2 additions & 1 deletion src/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ static void LinkTable_uninitialised_fill(LinkTable *linktbl)
*/
static LinkTable *single_LinkTable_new(const char *url)
{
char *ptr = strrchr(url, '/') + 1;
char *orig_ptr = strrchr(url, '/') + 1;
char *ptr = curl_easy_unescape(NULL, orig_ptr, 0, NULL);
LinkTable *linktbl = LinkTable_alloc(url);
Link *link = Link_new(ptr, LINK_UNINITIALISED_FILE);
strncpy(link->f_url, url, MAX_FILENAME_LEN);
Expand Down

0 comments on commit 720db5a

Please sign in to comment.