Bug report: Custom button-bar parameter error

Support for Android version of Total Commander

Moderators: sheep, Hacker, Stefan2, white

Post Reply
ruuma
Junior Member
Junior Member
Posts: 3
Joined: 2017-01-04, 19:06 UTC

Bug report: Custom button-bar parameter error

Post by *ruuma » 2017-12-29, 03:26 UTC

Hi. I am using Total Commander v2.80 for Android and experience an error when using custom button-bar buttons that use the %P or %P%N parameters with paths containing round brackets before the final slash of the path. The error does not occur when using %T or %T%M in the inactive panel.

Here is a very basic example that produces the error...

Function type: Send shell command
Command: su
Parameters: *echo "%P%N"

If the path contains round brackets before the final slash I get the following error: sh: <stdin>[1]: syntax error: '(' unexpected

Example of path creating error: /storage/8CE0-6T02/folder_(2017)/file.ext

If the round brackets are only within the final section of the path then there is no error, eg: /storage/8CE0-6T02/folder_(2017)

I have also tried using printf "%s" "%P%N" but the error still occurs. Neither single or double quotes around the parameter seem to help either.

Maybe this is a bug. Thank you for making this great file manager. It is always the first app that I install.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38384
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-12-29, 15:14 UTC

TC is just passing the name 1:1 to the shell (sh or su). Maybe I need to escape brackets somehow?
Author of Total Commander
http://www.ghisler.com

ruuma
Junior Member
Junior Member
Posts: 3
Joined: 2017-01-04, 19:06 UTC

Post by *ruuma » 2017-12-29, 20:37 UTC

ghisler(Author) wrote:TC is just passing the name 1:1 to the shell (sh or su). Maybe I need to escape brackets somehow?
Perhaps escaping all round brackets in file paths might fix this, or maybe quoting all file paths before passing them to the shell. I am still a novice so I'm sorry that I can't really offer any helpful advice.

I like to use custom buttons to pass info from TC to scripts and the terminal emulator. I found a workaround for this problem by using TC's internal command for the button bar 'Full names to clipboard' and then pasting this into the terminal emulator and quoting it.

Also, I incorrectly said that the error does not occur when using these same error producing paths in the inactive panel when using %T%M as parameters. I checked again and the error does also occur with %T%M if the active panel's path also contains round brackets.

dixitarjun
New Member
New Member
Posts: 1
Joined: 2018-03-06, 20:47 UTC

Post by *dixitarjun » 2018-03-06, 20:50 UTC

Glisher, I'd like to report one more bug. As I have updated to Android 8.0 on my Google Pixel 2 XL the app is only displaying a white blank screen and gradually crashes constantly. Please release a patch soon. Thanks in advance :)

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38384
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-03-08, 10:06 UTC

So far I haven't received any similar reports. Please try to uninstall and then re-install Total Commander.
Author of Total Commander
http://www.ghisler.com

Post Reply