diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-04-17T10·16+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-04-17T10·16+0200 |
commit | a4aac7f88c59c97299027c9668461c637bbc6a72 (patch) | |
tree | 0e336cdcb5e619486aea7cf263ce67fc19b1b2a4 /src | |
parent | c74f838620053dd914b948b775d4e7b168099348 (diff) |
Handle arguments in $EDITOR
Fixes #2079.
Diffstat (limited to 'src')
-rw-r--r-- | src/nix/edit.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/edit.cc b/src/nix/edit.cc index 7eaa86e2f914..c9671f76d0fa 100644 --- a/src/nix/edit.cc +++ b/src/nix/edit.cc @@ -61,7 +61,7 @@ struct CmdEdit : InstallableCommand auto editor = getEnv("EDITOR", "cat"); - Strings args{editor}; + auto args = tokenizeString<Strings>(editor); if (editor.find("emacs") != std::string::npos || editor.find("nano") != std::string::npos || @@ -72,7 +72,7 @@ struct CmdEdit : InstallableCommand stopProgressBar(); - execvp(editor.c_str(), stringsToCharPtrs(args).data()); + execvp(args.front().c_str(), stringsToCharPtrs(args).data()); throw SysError("cannot run editor '%s'", editor); } |