Ticket #1425 (closed defect: fixed)
External editor won't open if there are spaces in EDITOR variable
Reported by: | andreitch | Owned by: | slavazanko |
---|---|---|---|
Priority: | minor | Milestone: | 4.7.0-pre2 |
Component: | mcedit | Version: | 4.6.2 |
Keywords: | editor | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: | committed-master |
Description (last modified by iNode) (diff)
If there are spaces in the EDITOR environment variable, mc won't load it.
These first two examples work, but the last ones don't:
EDITOR=emacs mc EDITOR=mcedit mc EDITOR='emacs -nw' mc EDITOR='mc -e' mc
I think it's a problem with my_system function (utilunix.c, line 128) when it calls execl and execlp. You can see by running this two little C programs that they don't work. The third one works as expected.
#include <unistd.h> int main(int argc, char *argv[]) { execlp("sh", "sh", "emacs -nw", (char *)NULL); return 0; }
#include <unistd.h> int main(int argc, char *argv[]) { execl("sh", "sh", "-c", "emacs -nw", (char *)NULL); return 0; }
#include <unistd.h> int main(int argc, char *argv[]) { execlp("sh", "sh", "-c", "emacs -nw", (char *)NULL); return 0; }
Change History
comment:1 Changed 15 years ago by iNode
- Component changed from mc-core to mcedit
- Description modified (diff)
- Milestone changed from 4.7 to 4.7.0-pre2
comment:2 Changed 15 years ago by slavazanko
- Status changed from new to accepted
- Owner set to slavazanko
- severity changed from no branch to on review
Created branch 1425_spaces_in_EDITOR (parent: master)
Initial changeset:deefd6f6570d20c0997d656d5d5f7c393dfc34ca
Review, please.
comment:3 Changed 15 years ago by slavazanko
branch rebased - changeset:4a5f02698e5f2cf78cc84201f15a63000789d86a
comment:5 Changed 15 years ago by angel_il
- Votes for changeset changed from styx to styx angel_il
- severity changed from on review to approved
Note: See
TracTickets for help on using
tickets.