aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-04-17 12:16:04 +0200
committerEelco Dolstra <edolstra@gmail.com>2018-04-17 12:16:04 +0200
commita4aac7f88c59c97299027c9668461c637bbc6a72 (patch)
tree0e336cdcb5e619486aea7cf263ce67fc19b1b2a4 /src/nix
parentc74f838620053dd914b948b775d4e7b168099348 (diff)
Handle arguments in $EDITOR
Fixes #2079.
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/edit.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/edit.cc b/src/nix/edit.cc
index 7eaa86e2f..c9671f76d 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);
}