aboutsummaryrefslogtreecommitdiff
path: root/shell/match.h
diff options
context:
space:
mode:
Diffstat (limited to 'shell/match.h')
-rw-r--r--shell/match.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/match.h b/shell/match.h
index 3fc4de340..90597ee54 100644
--- a/shell/match.h
+++ b/shell/match.h
@@ -2,12 +2,12 @@
2 2
3PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN 3PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
4 4
5typedef char *(*scan_t)(char *string, char *match, bool zero); 5typedef char *(*scan_t)(char *string, char *match, bool match_at_left);
6 6
7char *scanleft(char *string, char *match, bool zero); 7char *scanleft(char *string, char *match, bool match_at_left);
8char *scanright(char *string, char *match, bool zero); 8char *scanright(char *string, char *match, bool match_at_left);
9 9
10static inline scan_t pick_scan(char op1, char op2, bool *zero) 10static inline scan_t pick_scan(char op1, char op2, bool *match_at_left)
11{ 11{
12 /* # - scanleft 12 /* # - scanleft
13 * ## - scanright 13 * ## - scanright
@@ -15,10 +15,10 @@ static inline scan_t pick_scan(char op1, char op2, bool *zero)
15 * %% - scanleft 15 * %% - scanleft
16 */ 16 */
17 if (op1 == '#') { 17 if (op1 == '#') {
18 *zero = true; 18 *match_at_left = true;
19 return op1 == op2 ? scanright : scanleft; 19 return op1 == op2 ? scanright : scanleft;
20 } else { 20 } else {
21 *zero = false; 21 *match_at_left = false;
22 return op1 == op2 ? scanleft : scanright; 22 return op1 == op2 ? scanleft : scanright;
23 } 23 }
24} 24}