aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-02-15 13:27:00 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-02-15 13:27:00 -0800
commit5b506499c1abafddeba13cb2edd37611a47f2379 (patch)
tree72943e3f4a4dbaf0cbf07d2b35a340f0691f1789 /src
parent62b76b26b4a8afc6987b65f0ad02a18dee093f2e (diff)
Use contains instead of string ==
Fix a few typos too
Diffstat (limited to 'src')
-rw-r--r--src/common.cpp2
-rw-r--r--src/parse_execution.cpp6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/common.cpp b/src/common.cpp
index aa5b77c8..21c4b92c 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -549,7 +549,7 @@ bool contains_internal(const wchar_t *a, int vararg_handle, ...)
return res;
}
-/* wcstring variant of contains_internal. The first parameter is a wcstring, the rest are const wchar_t *. vararg_handle exists only to give us a POD-value to apss to va_start */
+/* wcstring variant of contains_internal. The first parameter is a wcstring, the rest are const wchar_t *. vararg_handle exists only to give us a POD-value to pass to va_start */
__sentinel bool contains_internal(const wcstring &needle, int vararg_handle, ...)
{
const wchar_t *arg;
diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp
index f15d0719..0ea0aba9 100644
--- a/src/parse_execution.cpp
+++ b/src/parse_execution.cpp
@@ -758,7 +758,7 @@ parse_execution_result_t parse_execution_context_t::report_errors(const parse_er
return parse_execution_errored;
}
-/* Reoports an unmatched wildcard error and returns parse_execution_errored */
+/* Reports an unmatched wildcard error and returns parse_execution_errored */
parse_execution_result_t parse_execution_context_t::report_unmatched_wildcard_error(const parse_node_t &unmatched_wildcard)
{
proc_set_last_status(STATUS_UNMATCHED_WILDCARD);
@@ -937,9 +937,7 @@ parse_execution_result_t parse_execution_context_t::populate_plain_process(job_t
}
else
{
- const globspec_t glob_behavior = (cmd == L"set" || cmd == L"count")
- ? nullglob
- : failglob;
+ const globspec_t glob_behavior = contains(cmd, L"set", L"count") ? nullglob : failglob;
/* Form the list of arguments. The command is the first argument. TODO: count hack, where we treat 'count --help' as different from 'count $foo' that expands to 'count --help'. fish 1.x never successfully did this, but it tried to! */
parse_execution_result_t arg_result = this->determine_arguments(statement, &argument_list, glob_behavior);
if (arg_result != parse_execution_success)