Skip to content

Fix local filepath on POSIX#513

Merged
RytoEX merged 1 commit intoobsproject:masterfrom
Warchamp7:fix-posix-local-files
Feb 4, 2026
Merged

Fix local filepath on POSIX#513
RytoEX merged 1 commit intoobsproject:masterfrom
Warchamp7:fix-posix-local-files

Conversation

@Warchamp7
Copy link
Member

Description

Fixes the leading / being trimmed on posix filesystems.

Motivation and Context

Want local files to work.

How Has This Been Tested?

Tested by Penwywern on Discord.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Warchamp7 Warchamp7 added the Bug Fix Non-breaking change which fixes an issue label Jan 27, 2026
@Penwy
Copy link

Penwy commented Jan 27, 2026

For precision : test was done on ubuntu 24.04

@RytoEX RytoEX self-assigned this Jan 28, 2026
@RytoEX RytoEX requested review from PatTheMav and RytoEX January 28, 2026 03:28
@PatTheMav
Copy link
Member

Before we merge a fix for just a single issue, it would be great if we could get confirmation for a full test suite of possible URLs being confirmed to work as expected, otherwise we just pile little fixes on top of each other (and I repeat my suggestion made offline to use std::filesystem:path, which has platform-specific implementations already).

@Warchamp7 Warchamp7 force-pushed the fix-posix-local-files branch from 3519c81 to c4597cd Compare January 29, 2026 22:38
@RytoEX RytoEX requested a review from PatTheMav February 2, 2026 23:11
Copy link
Member

@PatTheMav PatTheMav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't break valid POSIX file paths anymore, but I haven't run a full gamut of checks for paths that are considered invalid by this.

Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per off-thread discussion, going to merge this, but would like to see more comprehensive testing (a list of URLs tested and expected and actual outcomes).

@RytoEX RytoEX force-pushed the fix-posix-local-files branch from c4597cd to 8c0dba8 Compare February 4, 2026 17:35
@RytoEX RytoEX changed the title frontend: Fix local filepath on posix Fix local filepath on POSIX Feb 4, 2026
@RytoEX
Copy link
Member

RytoEX commented Feb 4, 2026

On Windows 11, I tested the following supported scenarios (all should load and therefore PASS).

Local File:

PASS: C:/test/path/test.html
PASS: C:/test/path/spaces in path/test.html

URL:

PASS: file:///C:\test\path\test.html
PASS: file://C:\test\path\test.html
PASS: file:///C:\test\path\spaces in path\test.html
PASS: file://C:\test\path\spaces in path\test.html

@RytoEX RytoEX merged commit f93477b into obsproject:master Feb 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Non-breaking change which fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants