Skip to content

Commit 3ec2191

Browse files
committed
Fix other ignoring upper byte of chars
1 parent 19e41ab commit 3ec2191

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/MoonSharp.Interpreter/CoreLib/StringLib/KopiLua_StrLib.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,15 @@ private static CharPtr match(MatchState ms, CharPtr s, CharPtr p)
357357
LUA_QL("%f") + " in pattern");
358358
ep = classend(ms, p); /* points to what is next */
359359
previous = (s == ms.src_init) ? '\0' : s[-1];
360-
if ((matchbracketclass((byte)(previous), p, ep - 1) != 0) ||
361-
(matchbracketclass((byte)(s[0]), p, ep - 1) == 0)) return null;
360+
if ((matchbracketclass(previous, p, ep - 1) != 0) ||
361+
(matchbracketclass(s[0], p, ep - 1) == 0)) return null;
362362
p = ep; goto init; /* else return match(ms, s, ep); */
363363
}
364364
default:
365365
{
366366
if (isdigit((char)(p[1])))
367367
{ /* capture results (%0-%9)? */
368-
s = match_capture(ms, s, (byte)(p[1]));
368+
s = match_capture(ms, s, p[1]);
369369
if (s == null) return null;
370370
p += 2; goto init; /* else return match(ms, s, p+2) */
371371
}
@@ -857,15 +857,15 @@ private static CharPtr scanformat(LuaState L, CharPtr strfrmt, CharPtr form)
857857
while (p[0] != '\0' && strchr(FLAGS, p[0]) != null) p = p.next(); /* skip flags */
858858
if ((uint)(p - strfrmt) >= (FLAGS.Length + 1))
859859
LuaLError(L, "invalid format (repeated flags)");
860-
if (isdigit((byte)(p[0]))) p = p.next(); /* skip width */
861-
if (isdigit((byte)(p[0]))) p = p.next(); /* (2 digits at most) */
860+
if (isdigit(p[0])) p = p.next(); /* skip width */
861+
if (isdigit(p[0])) p = p.next(); /* (2 digits at most) */
862862
if (p[0] == '.')
863863
{
864864
p = p.next();
865-
if (isdigit((byte)(p[0]))) p = p.next(); /* skip precision */
866-
if (isdigit((byte)(p[0]))) p = p.next(); /* (2 digits at most) */
865+
if (isdigit(p[0])) p = p.next(); /* skip precision */
866+
if (isdigit(p[0])) p = p.next(); /* (2 digits at most) */
867867
}
868-
if (isdigit((byte)(p[0])))
868+
if (isdigit(p[0]))
869869
LuaLError(L, "invalid format (width or precision too long)");
870870
form[0] = '%';
871871
form = form.next();

0 commit comments

Comments
 (0)