Skip to content

Don't apply custom Path prefix twice - #153

Open
lforchini wants to merge 1 commit into
refactor/util-pathfrom
fix-double-path-bug
Open

lforchini wants to merge 1 commit into
refactor/util-pathfrom
fix-double-path-bug

Conversation

@lforchini

Copy link
Copy Markdown
Collaborator

In some instances, a prefix could be appended twice. Some config
loading functions would take a util::Path (prefixed), convert it to a
std::*::Path (still prefixed), and then convert it to a util::Path
again, doubling the prefix. Don't perform this intermediate step,
directly append to the util::Path.

Signed-off-by: Leonardo Forchini leonardo.forchini@nutanix.com


Stack created with GitHub Stacks CLI • Give Feedback 💬

@lforchini
lforchini added this pull request to stack #157 October 23, 2026 08:45
@lforchini
lforchini removed this pull request from stack #157 October 23, 2026 08:49
@lforchini
lforchini added this pull request to stack #159 October 23, 2026 08:50
@lforchini
lforchini force-pushed the fix-double-path-bug branch from 82c32e8 to 7628305 Compare October 29, 2026 14:29
@lforchini
lforchini removed this pull request from stack #159 October 30, 2026 10:48
@lforchini
lforchini force-pushed the fix-double-path-bug branch from 7628305 to fc21251 Compare October 30, 2026 10:49
@lforchini
lforchini added this pull request to stack #173 October 30, 2026 10:50
@lforchini
lforchini marked this pull request as ready for review October 30, 2026 10:51

@tmakatos tmakatos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this a bug fix or a minor improvement? I would think the former since we use util::Path which means it could be /foo/proc/... and because of the intermediate (util::)Path::new it would end up as /foo/foo/proc/..., right?

Nit, doesn't the prefix get prepended, not appended?

@lforchini
lforchini removed this pull request from stack #173 November 5, 2026 15:02
@lforchini
lforchini force-pushed the fix-double-path-bug branch from fc21251 to e5ce185 Compare November 5, 2026 15:03
@lforchini
lforchini changed the base branch from test/refactor-config-loading to refactor/util-path November 5, 2026 15:03
@lforchini
lforchini added this pull request to stack #176 November 5, 2026 15:03
@lforchini
lforchini removed this pull request from stack #176 November 5, 2026 15:09
@lforchini
lforchini force-pushed the fix-double-path-bug branch from e5ce185 to 7923751 Compare November 5, 2026 15:10
@lforchini
lforchini added this pull request to stack #178 November 5, 2026 15:10
@lforchini
lforchini removed this pull request from stack #178 November 6, 2026 10:23
@lforchini
lforchini force-pushed the fix-double-path-bug branch from 7923751 to be6f7e9 Compare November 6, 2026 10:24
@lforchini
lforchini added this pull request to stack #180 November 6, 2026 10:24
@lforchini

Copy link
Copy Markdown
Collaborator Author

It's a bugfix for the reason you mention. I've updated the commit message to say prepend.

@lforchini
lforchini force-pushed the fix-double-path-bug branch 2 times, most recently from fc19b11 to 4a5bde5 Compare November 13, 2026 09:38
In some instances, a prefix could be prepended twice. Some config
loading functions would take a `util::Path` (prefixed), convert it to a
`std::*::Path` (still prefixed), and then convert it to a `util::Path`
again, doubling the prefix. Don't perform this intermediate step,
directly append to the `util::Path`.

Signed-off-by: Leonardo Forchini <leonardo.forchini@nutanix.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants