Merge branch 'fix/execl-null-sentinel' of git://github.com/dtzWill/nix

This commit is contained in:
Shea Levy 2018-03-21 23:25:53 -04:00
commit c24e0439b2
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -263,7 +263,7 @@ void showManPage(const string & name)
{ {
restoreSignals(); restoreSignals();
setenv("MANPATH", settings.nixManDir.c_str(), 1); setenv("MANPATH", settings.nixManDir.c_str(), 1);
execlp("man", "man", name.c_str(), NULL); execlp("man", "man", name.c_str(), nullptr);
throw SysError(format("command 'man %1%' failed") % name.c_str()); throw SysError(format("command 'man %1%' failed") % name.c_str());
} }
@ -325,10 +325,10 @@ RunPager::RunPager()
setenv("LESS", "FRSXMK", 1); setenv("LESS", "FRSXMK", 1);
restoreSignals(); restoreSignals();
if (pager) if (pager)
execl("/bin/sh", "sh", "-c", pager, NULL); execl("/bin/sh", "sh", "-c", pager, nullptr);
execlp("pager", "pager", NULL); execlp("pager", "pager", nullptr);
execlp("less", "less", NULL); execlp("less", "less", nullptr);
execlp("more", "more", NULL); execlp("more", "more", nullptr);
throw SysError(format("executing '%1%'") % pager); throw SysError(format("executing '%1%'") % pager);
}); });