You are here

[Bug] PAL incorrectly backslashing numbers in java:utils:prefs

8 posts / 0 new
Last post
CODYQX4
Offline
Last seen: 2 years 11 months ago
Joined: 2010-04-23 20:39
[Bug] PAL incorrectly backslashing numbers in java:utils:prefs

I have been redoing all my apps for better directory app, some of these apps are in the SkyDrive link I link all Dev Tests to, but have no topic.

One of these apps is TinyUmbrella, and it stores a path in the registry in java:utils:prefs format. I was able to get directory switching working, but it seems I have either found a bug or the app deviates from this format (which I doubt).

I can switch paths, but if I put a number in one of the directory files, the path gets messed up.

For example, TinyUmbrellaPortable is OK, but if I add a 2, the path gets broken.

I looked at the registry files on how PAL writes it VS how the app would write the path.

I determined PAL is backslashing numbers in the path that shouldn't be backslashed.

Here is an example

PAL:
"/S/A/V/E_/D/I/R/E/C/T/O/R/Y"="/C:///Users///Cody///Desktop///Tiny/Umbrella/Portable/2/3///Data//.shsh"

Normal App:
"/S/A/V/E_/D/I/R/E/C/T/O/R/Y"="/C:///Users///Cody///Desktop///Tiny/Umbrella/Portable23///Data//.shsh"

The 2 gets a / and so does the 3, but it shouldn't, and this breaks the app.

CODYQX4
Offline
Last seen: 2 years 11 months ago
Joined: 2010-04-23 20:39
Not sure why nobody has

Not sure why nobody has answered.

I have confirmed this as a bug, as any Java App using the java.utils.prefs will store it without slashing the numbers.

So PAL is running on the false assumption that numbers should be slashed.

The documentation says that:

The path gets stored with a forward slash as the separator, and then all characters other than a colon and lower-case letters are escaped with a slash (including the path separator), so that a Windows path like X:\PortableApps\AppNamePortable will become /X:///Portable/Apps///App/Name/Portable.

This is false, numbers are not slashed, as I confirmed by writing a basic java app to store these values.

I:\PortableApps\TinyUmbrellaPortable=/I:///Portable/Apps///Tiny/Umbrella/Portable
I:\PortableApps\TinyUmbrellaPortable23=/I:///Portable/Apps///Tiny/Umbrella/Portable23

Gord Caswell
Gord Caswell's picture
Online
Last seen: 11 min 47 sec ago
DeveloperModerator
Joined: 2008-07-24 18:46
Clarification

I'm looking for some clarification on the problem. You indicated in your original post that numbers were being backslashed, as they should, and yet in this post you've indicated that they are not. Which is it, and what is the desired behaviour?

Gord Caswell
Gord Caswell's picture
Online
Last seen: 11 min 47 sec ago
DeveloperModerator
Joined: 2008-07-24 18:46
Backslashed, should not be

Based some research I've now done, it appears that PAL is backslashing numbers within path strings and should not be. Accordingly, I've got a fix ready, and will push it to PAL's repo in the next day or so.

Gord Caswell
Gord Caswell's picture
Online
Last seen: 11 min 47 sec ago
DeveloperModerator
Joined: 2008-07-24 18:46
Pull Request

I've made a pull request against my copy of the repo - can someone try the fix and confirm independently if this fixes the problem?

Otherwise, I'll try the fix myself when I'm no longer restricted by my corporate environment.

[EDIT] Missed including the link: https://github.com/GordCaswell/portableapps.comlauncher/pull/1

Gord Caswell
Gord Caswell's picture
Online
Last seen: 11 min 47 sec ago
DeveloperModerator
Joined: 2008-07-24 18:46
Appears to fix, need confirmation

I believe I've fixed the problem. Can someone else please confirm if this is the correct behaviour, and I'll merge it in for the next update.

With current PAL:

/S:///Testing/1/2/3///Virus/Total/Uploader/Portable///App

With fix applied:

/S:///Testing123///Virus/Total/Uploader/Portable///App
JLim
Offline
Last seen: 3 months 4 weeks ago
Joined: 2013-07-17 01:30
add make QuadBackslash path

May I suggest to add the make QuadBackslash path by John as in the custom code of K-MeleonPortable 75.1 to Variables.nsh too?

Gord Caswell
Gord Caswell's picture
Online
Last seen: 11 min 47 sec ago
DeveloperModerator
Joined: 2008-07-24 18:46
Likely

It's likely I can add that, I'll have to take a quick look at the code to check, but it shouldn't be hard.

Log in or register to post comments