Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe Slashes in ppsspp.ini #9335

Closed
tilkinsc opened this issue Feb 20, 2017 · 8 comments
Closed

Unsafe Slashes in ppsspp.ini #9335

tilkinsc opened this issue Feb 20, 2017 · 8 comments

Comments

@tilkinsc
Copy link
Contributor

tilkinsc commented Feb 20, 2017

Looking through some source files, I know how much you care about which way the slash goes on windows versus other platforms. While windows accepts forwards slashes, and the mixture of the two, I don't think something correct is happening here - in that it is way too volatile. FileName0 has a V. It much be much easier to convert the entire system to / instead of messing around with / and \ correctness. In fact, I use / almost always on windows. Fixing specific broken features would be easier on a per-problem basis.

FileName0 = C:\pspsdk\projects\file_io/bin/EBOOT.PBP
FileName1 = C:/Users/Bud/Desktop/ppsspp/memstick/PSP/GAME/bin
FileName2 = C:/Users/Bud/Desktop/ppsspp/memstick/PSP/GAME/test/EBOOT.PBP
FileName3 = C:\pspsdk\psp\sdk\samples\net\simple\EBOOT.PBP
FileName4 = C:\pspsdk\psp\sdk\samples\kernel\threadstatus\EBOOT.PBP
FileName5 = C:\pspsdk\psp\sdk\samples\kernel\systimer\EBOOT.PBP
FileName6 = C:\pspsdk\psp\sdk\samples\kernel\sysevent\EBOOT.PBP
FileName7 = C:/pspsdk/psp/sdk/samples/kernel/registry/EBOOT.PBP
FileName8 = C:\pspsdk\psp\sdk\samples\kernel\regenum\EBOOT.PBP
FileName9 = C:\pspsdk\psp\sdk\samples\kernel\messagebox\EBOOT.PBP
FileName10 = C:\pspsdk\psp\sdk\samples\kernel\loadmodule\EBOOT.PBP
FileName11 = C:\pspsdk\psp\sdk\samples\kernel\idstorage\EBOOT.PBP
FileName12 = C:\pspsdk\psp\sdk\samples\kernel\cwd\EBOOT.PBP
FileName13 = C:\pspsdk\psp\sdk\samples\kernel\fileio\EBOOT.PBP
FileName14 = C:\pspsdk\projects\user_input/bin/EBOOT.PBP < btw here is the UserInput tutorial
FileName15 = C:\pspsdk\projects\lua/bin/EBOOT.PBP
FileName16 = C:\pspsdk\projects\lua\bin/EBOOT.PBP
FileName17 = C:/pspsdk/projects/hello_world/bin/EBOOT.PBP

@hrydgard
Copy link
Owner

Hm, yeah, this would be the cause of duplicates showing up. Needs looking into

hrydgard added a commit that referenced this issue Feb 21, 2017
Note that this doesn't fix existing backslashes but solves it in the
long run.
@hrydgard
Copy link
Owner

Alright, that should take care of it as you use it (no more backslashes will be added to the list).

Though, how are you starting the games so that the backslashes end up there? I tried both clicking game buttons and Load File and got forward slashes. Command line?

@tilkinsc
Copy link
Contributor Author

I use the command line with an absolute path.

@echo off
TITLE Running EBOOT.PBP...

IF NOT EXIST bin/EBOOT.PBP (
	echo Failed to find EBOOT.PBP in bin!
	pause
	goto end
)

setlocal

call using %PSPToolchain% q

echo Running...

ppsspp.lnk "%~dp0/bin/EBOOT.PBP"

endlocal

echo Done.

:end

call using %PSPToolchain% q quietly inserts a temporary temporary addition to PATH. %~dp0 is the current working directory.

@tilkinsc
Copy link
Contributor Author

tilkinsc commented Feb 23, 2017

Now that I think of it, %~dp0 could be the culprit because it will give the path in Windows slashes. The files loaded through PPSSPP gui is probably the only forward slashes.

One more thing, could you add an addition that makes it possible for relative paths to be used? I can only use absolute paths. I think a simple absolute path get of the loaded PBP using relative path is what is needed to do the checks and stuff you added with one of the homebrew bug fixes.

hrydgard added a commit that referenced this issue Feb 23, 2017
@hrydgard
Copy link
Owner

Right, I missed the command line path - added a fix now to replace the slashes already there. Could probably remove the other fix now, but meh.

Did not add any explicit support for relative paths yet.

@hrydgard
Copy link
Owner

This is good enough now I think, closing.

@unknownbrackets
Copy link
Collaborator

It at least used to be you could use relative paths. I think at some point PPSSPP was changed to chdir to its own directory, so I guess they might be relative to its directory now?

-[Unknown]

@tilkinsc
Copy link
Contributor Author

Relative paths are working fine.

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

No branches or pull requests

3 participants