aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 58da0a2a0..cfcc0b818 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -207,17 +207,17 @@
#define IF_BASH_SUBSTR IF_ASH_BASH_COMPAT
/* BASH_TEST2: [[ EXPR ]]
* Status of [[ support:
- * We replace && and || with -a and -o
+ * && and || work as they should
+ * = is glob match operator, not equality operator: STR = GLOB
+ * (in GLOB, quoting is significant on char-by-char basis: a*cd"*")
+ * == same as =
+ * add =~ regex match operator: STR =~ REGEX
* TODO:
* singleword+noglob expansion:
* v='a b'; [[ $v = 'a b' ]]; echo 0:$?
* [[ /bin/n* ]]; echo 0:$?
- * -a/-o are not AND/OR ops! (they are just strings)
* quoting needs to be considered (-f is an operator, "-f" and ""-f are not; etc)
- * = is glob match operator, not equality operator: STR = GLOB
- * (in GLOB, quoting is significant on char-by-char basis: a*cd"*")
- * == same as =
- * add =~ regex match operator: STR =~ REGEX
+ * ( ) < > should not have special meaning
*/
#define BASH_TEST2 (ENABLE_ASH_BASH_COMPAT * ENABLE_ASH_TEST)
#define BASH_SOURCE ENABLE_ASH_BASH_COMPAT
@@ -11823,7 +11823,8 @@ simplecmd(void)
tokpushback = 1;
goto out;
}
- wordtext = (char *) (t == TAND ? "-a" : "-o");
+ /* pass "&&" or "||" to [[ ]] as literal args */
+ wordtext = (char *) (t == TAND ? "&&" : "||");
#endif
case TWORD:
n = stzalloc(sizeof(struct narg));