about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-04-17T10·16+0200
committerEelco Dolstra <edolstra@gmail.com>2018-04-17T10·16+0200
commita4aac7f88c59c97299027c9668461c637bbc6a72 (patch)
tree0e336cdcb5e619486aea7cf263ce67fc19b1b2a4 /src
parentc74f838620053dd914b948b775d4e7b168099348 (diff)
Handle arguments in $EDITOR
Fixes #2079.
Diffstat (limited to 'src')
-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 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);
     }