X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fexpr.c;h=499b9619d58062145fe28e5215a44a2922885d3f;hb=dd4abe0a6aa4badb34480972d393466bf0e4c66b;hp=12989d4698695a1f9991de84639417c5422b1d5a;hpb=ab3794bf039b656a72cc0a68c3674bd5b0954eee;p=android-x86%2Fexternal-mksh.git diff --git a/src/expr.c b/src/expr.c index 12989d4..499b961 100644 --- a/src/expr.c +++ b/src/expr.c @@ -2,7 +2,7 @@ /*- * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - * 2011, 2012, 2013, 2014, 2016, 2017 + * 2011, 2012, 2013, 2014, 2016, 2017, 2018 * mirabilos * * Provided that these terms and disclaimer and all copyright notices @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.100 2017/08/07 21:38:55 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.103 2018/01/14 01:29:47 tg Exp $"); #define EXPRTOK_DEFNS #include "exprtok.h" @@ -558,9 +558,11 @@ exprtoken(Expr_state *es) /* skip whitespace */ skip_spaces: - while (ctype(ord((c = *cp)), C_SPACE)) - ++cp; - if (es->tokp == es->expression && c == ord('#')) { + --cp; + do { + c = ord(*++cp); + } while (ctype(c, C_SPACE)); + if (es->tokp == es->expression && (unsigned int)c == ORD('#')) { /* expression begins with # */ /* switch to unsigned */ es->natural = true; @@ -575,7 +577,7 @@ exprtoken(Expr_state *es) do { c = ord(*++cp); } while (ctype(c, C_ALNUX)); - if (c == ord('[')) { + if ((unsigned int)c == ORD('[')) { size_t len; len = array_ref_len(cp); @@ -884,7 +886,7 @@ static int mb_ucsbsearch(const struct mb_ucsrange arr[], size_t elems, /* * Generated from the Unicode Character Database, Version 10.0.0, by - * MirOS: contrib/code/Snippets/eawparse,v 1.10 2017/07/12 22:47:26 tg Exp $ + * MirOS: contrib/code/Snippets/eawparse,v 1.12 2017/09/06 16:05:45 tg Exp $ */ static const struct mb_ucsrange mb_ucs_combining[] = { @@ -895,16 +897,14 @@ static const struct mb_ucsrange mb_ucs_combining[] = { { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, - { 0x0600, 0x0605 }, { 0x0610, 0x061A }, { 0x061C, 0x061C }, { 0x064B, 0x065F }, { 0x0670, 0x0670 }, - { 0x06D6, 0x06DD }, + { 0x06D6, 0x06DC }, { 0x06DF, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, - { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, @@ -914,7 +914,8 @@ static const struct mb_ucsrange mb_ucs_combining[] = { { 0x0825, 0x0827 }, { 0x0829, 0x082D }, { 0x0859, 0x085B }, - { 0x08D4, 0x0902 }, + { 0x08D4, 0x08E1 }, + { 0x08E3, 0x0902 }, { 0x093A, 0x093A }, { 0x093C, 0x093C }, { 0x0941, 0x0948 },