Problems with trailing backslashes

Bugs and issues - current donor version.
Post Reply
Message
Author
catweazle9
Posts: 23
Joined: 30.03.2009, 10:37

Problems with trailing backslashes

#1 Post by catweazle9 » 06.10.2012, 18:11

If I invoke FreeCommander from the command line as follows:

FreeCommander.exe /C /T /R=C:\Windows\

.. the folder is displayed in the right pane (as expected), but pressing Backspace (or clicking the two dots) to move up a folder has no effect.

It would be very helpful if FreeCommand could strip any trailing backslashes from the path and allow this to work. I have an External Command defined in Visual Studio which launches FreeCommander to display the folder of the current file I'm editing. The Visual Studio settings to configure the external command are:

Title: FreeCommander
Command: C:\Program Files\FreeCommander\FreeCommander.exe
Arguments: /C /T "/R=$(ItemDir)"
Initial Directory: <blank>
.. with all checkboxes unticked.

Unfortunately, the $(ItemDir) path includes the trailing backslash (sometimes two backslashes, I think).

As a workaround I've configured the Visual Studio external command to invoke the bat file below, but it triggers an ugly command prompt window and seems clunky.

Thanks,

--- John.

REM Triggers FreeCommanderXE to display the given directory, after first stripping any trailing slash
REM If the slash is left intact then Backspace (up directory) doesn't work.
REM Remove quotes from the argument - http://weblogs.asp.net/jgalloway/archiv ... batch.aspx
set dirpath=%~1

if "%dirpath%" == "" exit

REM Remove trailing slash - http://stackoverflow.com/questions/2952 ... file-input
if %dirpath:~-1%==\ set dirpath=%dirpath:~0,-1%
REM Do it again as the $(ItemDir) argument from Visual Studio oddly has 2 trailing backslashes
if %dirpath:~-1%==\ set dirpath=%dirpath:~0,-1%

echo %dirpath%

"C:\Program Files (x86)\FreeCommander XE\FreeCommander.exe" /C /T /R=%dirpath%

Marek
Author
Author
Posts: 3974
Joined: 10.04.2006, 09:48
Location: Germany
Contact:

Re: Problems with trailing backslashes

#2 Post by Marek » 08.10.2012, 22:16

Fixed for the release 602.

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests