Skip to content

Commit

Permalink
Fix relative URL rewriting bug (Issue #507)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Sep 13, 2023
1 parent cbf3130 commit 296281a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
- Updated PostScript and PDF date/time information to use UTC (Issue #490)
- Fixed multiple conversions of UTF-8 HTML files from the GUI (Issue #496)
- Fixed a compile bug on Solaris (Issue #498)
- Fixed a markdown parsing issue (Issue #503)
- Fixed a markdown parsing bug (Issue #503)
- Fixed a relative URL handling bug (Issue #507)
- Fixed a crash bug with bad title images (Issue #510)
- Fixed some minor CodeQL warnings.

Expand Down
6 changes: 1 addition & 5 deletions htmldoc/htmllib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3460,7 +3460,7 @@ fix_filename(char *filename, /* I - Original filename */
static char newfilename[1024]; /* New filename */


// printf("fix_filename(filename=\"%s\", base=\"%s\")\n", filename, base);
printf("fix_filename(filename=\"%s\", base=\"%s\")\n", filename, base);

This comment has been minimized.

Copy link
@step-

step- Sep 14, 2023

forgot debug line?

This comment has been minimized.

Copy link
@michaelrsweet

michaelrsweet Sep 14, 2023

Author Owner

Oops, fixed...


if (filename == NULL)
return (NULL);
Expand Down Expand Up @@ -3529,10 +3529,6 @@ fix_filename(char *filename, /* I - Original filename */
}
else
{
// Relative path, strip the last component from the resource...
if ((slash = strrchr(resource, '/')) != NULL)
*slash = '\0';

// Handle "../" in filename...
while (!strncmp(filename, "../", 3))
{
Expand Down

0 comments on commit 296281a

Please sign in to comment.