Imported Upstream version 5.3.4
[platform/upstream/lua.git] / src / lua.c
index 545d23d..3f082da 100644 (file)
--- a/src/lua.c
+++ b/src/lua.c
@@ -1,5 +1,5 @@
 /*
-** $Id: lua.c,v 1.226 2015/08/14 19:11:20 roberto Exp $
+** $Id: lua.c,v 1.230 2017/01/12 17:14:26 roberto Exp $
 ** Lua stand-alone interpreter
 ** See Copyright Notice in lua.h
 */
@@ -20,6 +20,7 @@
 #include "lualib.h"
 
 
+
 #if !defined(LUA_PROMPT)
 #define LUA_PROMPT             "> "
 #define LUA_PROMPT2            ">> "
@@ -37,8 +38,7 @@
 #define LUA_INIT_VAR           "LUA_INIT"
 #endif
 
-#define LUA_INITVARVERSION  \
-       LUA_INIT_VAR "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR
+#define LUA_INITVARVERSION     LUA_INIT_VAR LUA_VERSUFFIX
 
 
 /*
@@ -55,6 +55,8 @@
 #elif defined(LUA_USE_WINDOWS) /* }{ */
 
 #include <io.h>
+#include <windows.h>
+
 #define lua_stdin_is_tty()     _isatty(_fileno(stdin))
 
 #else                          /* }{ */
@@ -457,7 +459,7 @@ static int handle_script (lua_State *L, char **argv) {
 /*
 ** Traverses all arguments from 'argv', returning a mask with those
 ** needed before running any Lua code (or an error code if it finds
-** any invalid argument). 'first' returns the first not-handled argument 
+** any invalid argument). 'first' returns the first not-handled argument
 ** (either the script name or a bad argument in case of error).
 */
 static int collectargs (char **argv, int *first) {
@@ -481,7 +483,7 @@ static int collectargs (char **argv, int *first) {
         args |= has_E;
         break;
       case 'i':
-        args |= has_i;  /* (-i implies -v) *//* FALLTHROUGH */ 
+        args |= has_i;  /* (-i implies -v) *//* FALLTHROUGH */
       case 'v':
         if (argv[i][2] != '\0')  /* extra characters after 1st? */
           return has_error;  /* invalid option */
@@ -529,6 +531,7 @@ static int runargs (lua_State *L, char **argv, int n) {
 }
 
 
+
 static int handle_luainit (lua_State *L) {
   const char *name = "=" LUA_INITVARVERSION;
   const char *init = getenv(name + 1);