Skip to content
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

Quick cd is relative in panelization #3824

Open
mc-butler opened this issue May 14, 2017 · 2 comments
Open

Quick cd is relative in panelization #3824

mc-butler opened this issue May 14, 2017 · 2 comments
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3824
Reporter andrew_b (@aborodin)

On panelized panel, the "Quick cd" command is always relative to panel working directory, even cd to absolute path.

How to reproduce:

  1. Assume, CWD of panel is ~/work.c/mc/3780_cleanup.
  2. Find something in the current panel.
  3. Panelize the find result.
  4. Run "Quick cd" command (alt-c), type / to cd to root directory, press Enter.

Result: you are in ~/work.c/mc/3780_cleanup.
Expected result: you are in /.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 4, 2017 at 4:57 UTC (comment 1)

The bug was introduced in [4dde82c] (do_cd() function).

Since vfs_path_t is an absolute path, previous test

_new_dir[0] == '.' && _new_dir[1] == '.' && _new_dir[2] == 0

and current one

vfs_path_equal_len (new_dir_vpath, panelized_panel.root_vpath, new_vpath_len)

are not equivalent.

Current test must be fixed to restore previous logic: new_dir_vpath is the parent directory for panelized_panel.root_vpath.

@mc-butler
Copy link
Author

Changed by mooffie (@mooffie) on Jun 8, 2017 at 17:25 UTC (comment 1.2)

The bug was introduced in [4dde82c].

Since vfs_path_t is an absolute path, previous test

_new_dir[0] == '.' && _new_dir[1] == '.' && _new_dir[2] == 0

[...]


I was aware of this. This is one of the panelization bugs #comment:8 I promised to open tickets for (#2942).

Much, if not all, of the panelization code was committed without code-review and without documentation. (The result proves the failure of the #comment:8 Sapienti sat (#3810) doctrine.) #3767 was intended as the 1st in a series of tickets for cleaning up the panelization system. I'm planning to get back to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Development

No branches or pull requests

1 participant