Browse Source

ESC (which starts precompiled code) in C is \33, not \27

Roberto Ierusalimschy 24 years ago
parent
commit
d444153dbe
2 changed files with 7 additions and 2 deletions
  1. 5 0
      bugs
  2. 2 2
      lbaselib.c

+ 5 - 0
bugs

@@ -259,3 +259,8 @@ Thu Feb  1 11:55:45 EDT 2001
 Fri Feb  2 14:06:40 EDT 2001
 Fri Feb  2 14:06:40 EDT 2001
 >> «while 1 dostring[[print('hello\n')]] end» never reclaims memory
 >> «while 1 dostring[[print('hello\n')]] end» never reclaims memory
 (by Andrew Paton; since 4.0b)
 (by Andrew Paton; since 4.0b)
+
+** lbaselib.c
+Tue Feb  6 11:57:13 EDT 2001
+>> ESC (which starts precompiled code) in C is \33, not \27
+(by Edgar Toernig and lhf; since 4.0b)

+ 2 - 2
lbaselib.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lbaselib.c,v 1.20 2001/01/31 19:53:01 roberto Exp roberto $
+** $Id: lbaselib.c,v 1.21 2001/02/02 19:02:40 roberto Exp roberto $
 ** Basic library
 ** Basic library
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -284,7 +284,7 @@ static int luaB_dostring (lua_State *L) {
   int oldtop = lua_gettop(L);
   int oldtop = lua_gettop(L);
   size_t l;
   size_t l;
   const char *s = luaL_check_lstr(L, 1, &l);
   const char *s = luaL_check_lstr(L, 1, &l);
-  if (*s == '\27')  /* binary files start with ESC... */
+  if (*s == '\33')  /* binary files start with ESC... */
     lua_error(L, "`dostring' cannot run pre-compiled code");
     lua_error(L, "`dostring' cannot run pre-compiled code");
   return passresults(L, lua_dobuffer(L, s, l, luaL_opt_string(L, 2, s)), oldtop);
   return passresults(L, lua_dobuffer(L, s, l, luaL_opt_string(L, 2, s)), oldtop);
 }
 }