Accept == as an alias of = which is a popular GNU extension.

This is intentionally undocumented for now since it's not part
of any standard.

MFC after:	1 month
This commit is contained in:
delphij 2011-02-27 12:28:06 +00:00
parent 1903daf0a4
commit fbf06de861
2 changed files with 5 additions and 1 deletions

View File

@ -144,6 +144,7 @@ struct t_op {
{"-L", FILSYM, UNOP},
{"-S", FILSOCK,UNOP},
{"=", STREQ, BINOP},
{"==", STREQ, BINOP},
{"!=", STRNE, BINOP},
{"<", STRLT, BINOP},
{">", STRGT, BINOP},

View File

@ -52,12 +52,15 @@ t ()
}
count=0
echo "1..94"
echo "1..97"
t 0 'b = b'
t 0 'b == b'
t 1 'b != b'
t 0 '\( b = b \)'
t 0 '\( b == b \)'
t 1 '! \( b = b \)'
t 1 '! \( b == b \)'
t 1 '! -f /etc/passwd'
t 0 '-h = -h'