Page 1 of 1

Bug report: Custom button-bar parameter error

Posted: 2017-12-29, 03:26 UTC
by ruuma
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.

Posted: 2017-12-29, 15:14 UTC
by ghisler(Author)
TC is just passing the name 1:1 to the shell (sh or su). Maybe I need to escape brackets somehow?

Posted: 2017-12-29, 20:37 UTC
by ruuma
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.

Posted: 2018-03-06, 20:50 UTC
by dixitarjun
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 :)

Posted: 2018-03-08, 10:06 UTC
by ghisler(Author)
So far I haven't received any similar reports. Please try to uninstall and then re-install Total Commander.