-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External panelize: opening a file with an absolute path fails #2942
Comments
I.e.: the variable MC_EXT_FILENAME appears to be set to ${HOME}/tmp/t.html instead of /tmp/t.html |
Confirmed, absolute paths result not respected by External panelize.
Patch attached. |
|
|
|
|
:-( |
|
Summary
When "External panelize" or "File find" think the result (the file list) has absolute paths, they set the panel's cwd_vpath property to "/" (and chdir() to there). This makes everything work (like patterns of the form "%d/%p" (there will be a double "/" at the beginning but that's harmless on POSIX systems), and ctrl+shift+enter for putting an absolute path on the command-line). The bug's immediate cause
For "External panelized", there's a bug in how do_external_panelize() detects absolute paths: it looks in the zero'th element (the "..") instead of the 1'st one. The bug's real cause
MC has several panelization-related bugs (I'll open tickets for individual bugs as time goes by). They all have one cause: lack of source-code documentation. This leads, as MC evolves and its code changes, to bugs because the intentions of the original programmer are lost. As for @and's patch
@and's patch doesn't fix the "real cause". Also, as my branch shows, there are seveal more fixes to be done. I went to the lengths of giving him credit in the 1st commit, though. (His optimization for the "\n" trimming will be handled in #3811 instead; "#define LABELS" in #3780.) |
|
NEWS-4.8.20 updated. |
Important
This issue was migrated from Trac:
ackalker
(a.c.kalker@….com)What version of Midnight Commander is used?
$ LC_MESSAGES=C mc -V
GNU Midnight Commander 4.8.6
Built with GLib 2.32.4
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
What steps will reproduce the problem?
$ touch /tmp/t.html
echo /tmp/t.html
What is the expected output?
The HTML file should open in my webbrowser
What do you see instead?
(using PCManFM) an Error popup saying "No such file or directory".
After editing the extension file to change the html / open action, I found that Midnight Commander is trying to open the file ${HOME}/tmp/t.html instead of /tmp/html.
Note. Viewing and editing files with absolute paths in External panelize works without problems.
Note
Original attachments:
and
onMar 5, 2016 at 15:45 UTC
The text was updated successfully, but these errors were encountered: