summaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-10-31 13:53:31 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-10-31 13:53:31 -0200
commitdcfc3c9405fac62c5808c33e1b4c82c45c5b2218 (patch)
treece48220cf2ff08dceb1ad71ac2dbe865da2fec66 /lstrlib.c
parent4542fb9f78ff72c6bc72be76385f9710ffee867a (diff)
downloadlua-github-dcfc3c9405fac62c5808c33e1b4c82c45c5b2218.tar.gz
new option '=' (native endian) for pack/unpack
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 387dcd70..caac826d 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.209 2014/10/28 18:23:31 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.210 2014/10/30 18:53:28 roberto Exp roberto $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -1086,6 +1086,7 @@ static KOption getoption (Header *h, const char **fmt, int *size) {
case ' ': return Knop;
case '<': h->islittle = 1; return Knop;
case '>': h->islittle = 0; return Knop;
+ case '=': h->islittle = nativeendian.little; return Knop;
case '!': h->maxalign = getnumlimit(h, fmt, MAXALIGN); return Knop;
default: {
luaL_error(h->L, "invalid format option '%c'", opt);