Jump to content

[BUG+FIX] Broken WPIPath trimming in browser dialog


Recommended Posts

How to reproduce

Go to Start Menu, Run, type the wpi.exe path changing the case of some of the path letters and launch it: when adding files to commands WPI will insert invalid paths.

Cause

WPI doesn't do case-insensitive replacement of %wpipath% when browsing for commands to add, meaning that if WPI isn't started typing the exact lowercase/uppercase path name the path trimming function won't work.

Fix

Replace the following lines in configwizard.js

		if (str.indexOf(wpipath) != -1)
{
trimpath=wpipath;
trimpathvar="%wpipath%"; //Could have used %cdrom%
}

with

		if ((WPIPathPosition=str.toLowerCase().indexOf(wpipath.toLowerCase())) != -1)
{
trimpath=str.substring(WPIPathPosition,wpipath.length);
trimpathvar="%wpipath%"; //Could have used %cdrom%
}

Edited by Francesco
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...