-
-
Notifications
You must be signed in to change notification settings - Fork 50
Ticket #4883: Invoke external rm command from mc wrappers #4917
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
base: master
Are you sure you want to change the base?
Ticket #4883: Invoke external rm command from mc wrappers #4917
Conversation
…ppers Avoid executing a shell alias or function. Signed-off-by: Egmont Koblinger <[email protected]>
|
looks good, but i wonder how far we should go with this. it is for example entirely plausible that someone messes with |
|
... and what if someone aliases I see a high chance of someone aliasing It's surely not obvious where to draw the line (e.g. whether to protect |
From a user's perspective, If the protection is as cheap as That's particularly true given the non-obvious nature of mc's various internal reliances on external commands - the user shouldn't need to worry about hidden interferences when using |
That would mean something like That's 18 Edit: And |
|
The more I think about it, the more I tend to think that the bug should be closed as rejected, the PR dropped. I'll make a comment about it in the bug. |
Style-wise I can only agree, whilst functionality-wise (including reliability, and clarity as to what to expect from certain actions), I can't. It's a dilemma, possibly resolvable by nothing but personal preference. Could you estimate the overall percentage of mc's codebase that would be affected by that clutter? |
It's only these six files. The cost rather comes from having to test these in all sorts of shells; the cost of anyone looking at those files wondering what goes on, the "risk" of a subsequent modification forgetting to add its At the same time we should also estimate the number of affected users, which I believe is 1 user over the course of 30 years. I'd much more work towards converting it to a function (except for csh), as per the comment I made in the bug. |
|
given that statistically only every 100th user bothers to report problems, it's probably a few more. technically, the behavior of the commands is defined by posix. but mc calls them in a context that does not guarantee posix behavior. formerly, the sh wrapper was in fact a function. 83cb1dd changed that specifically to avoid use of functions, with no reason given. it might be to support pre-posix shells, or for uniformity between sh and csh. @proski might remember. |
Avoid executing a shell alias or function.
Proposed changes
Checklist
👉 Our coding style can be found here: https://midnight-commander.org/coding-style/ 👈
git commit --amend -smake indent && make check)