Skip to content

Conversation

@Starfelll
Copy link
Contributor

No description provided.

@Starfelll Starfelll closed this Jan 8, 2025
@Starfelll Starfelll reopened this Jan 8, 2025
@craftablescience craftablescience added the bug Something isn't working label Jan 8, 2025
Copy link
Owner

@craftablescience craftablescience left a comment

Choose a reason for hiding this comment

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

The true fix is fixing up the slashes directly when this->fullFilePath is set in the constructor, as the code assumes everywhere that it's using normalized slashes when it possibly isn't.

This change at L109 should be all that's required to fix the bug:

PackFile::PackFile(std::string fullFilePath_)
-		: fullFilePath(std::move(fullFilePath_)) {}
		: fullFilePath(std::move(fullFilePath_)) {
+	string::normalizeSlashes(this->fullFilePath);
+}

@Starfelll
Copy link
Contributor Author

You're right, this code is better.

I'm working on a win32 shell extension. It's hard to use a debugger because of some security factors, so I wrote a test program to call this extension.
The bug eats the parent path leaving only basename, unluckily my test file was in the same directory as the test program, and I don't want to talk about what happened next.
I was also plagued by some black magic with the win32 shell before this. Have lost my mind a bit while preparing this request.

@craftablescience
Copy link
Owner

I don't want to talk about what happened next

oh gosh I'm sorry 😭

I made a thumbnailer for VTF files and debugging that was really hard, so I can sympathize

@craftablescience craftablescience merged commit 353aee7 into craftablescience:main Jan 27, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants