summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/stream.cc12
-rw-r--r--src/token.cc3
2 files changed, 4 insertions, 11 deletions
diff --git a/src/stream.cc b/src/stream.cc
index fcd030b6..e4eb7800 100644
--- a/src/stream.cc
+++ b/src/stream.cc
@@ -80,18 +80,10 @@ namespace {
close(pfd[1]);
close(pfd[0]);
- // Find command name: its the substring starting right of the
- // rightmost '/' character in the pager pathname. See manpage for
- // strrchr.
-#if BOOST_VERSION >= 103700
- path basename(pager_path.filename());
-#else
- path basename(pager_path.leaf());
-#endif
- execlp(pager_path.string().c_str(), basename.string().c_str(), NULL);
+ execlp("/bin/sh", "/bin/sh", "-c", pager_path.string().c_str(), NULL);
// We should never, ever reach here
- perror((std::string("execlp: ") + pager_path.string()).c_str());
+ perror("execlp: /bin/sh");
exit(1);
}
else { // parent
diff --git a/src/token.cc b/src/token.cc
index 6ca649bb..aa78cd5a 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -522,7 +522,8 @@ void expr_t::token_t::expected(const char wanted, char c)
void expr_t::token_t::expected(const kind_t wanted)
{
try {
- if (wanted == '\0' || wanted == -1)
+ if (wanted == expr_t::token_t::ERROR ||
+ wanted == expr_t::token_t::UNKNOWN)
throw_(parse_error, _f("Invalid token '%1%'") % *this);
else
throw_(parse_error,