From 47c562435bd82b5ac5b8574fe80d2ff2ff8f9452 Mon Sep 17 00:00:00 2001
From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 19 Jun 2009 11:21:57 -0300
Subject: better error messages for luaL_checkversion

---
 lauxlib.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'lauxlib.c')

diff --git a/lauxlib.c b/lauxlib.c
index 72cfe04a..f021686a 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
 /*
-** $Id: lauxlib.c,v 1.186 2009/04/02 19:54:06 roberto Exp roberto $
+** $Id: lauxlib.c,v 1.187 2009/06/18 18:59:58 roberto Exp roberto $
 ** Auxiliary functions for building Lua libraries
 ** See Copyright Notice in lua.h
 */
@@ -744,8 +744,9 @@ LUALIB_API lua_State *luaL_newstate (void) {
 LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) {
   const lua_Number *v = lua_version(L);
   if (v != lua_version(NULL))
-    luaL_error(L, "application using two incompatible Lua VMs");
+    luaL_error(L, "multiple Lua VMs detected");
   else if (*v != ver)
-    luaL_error(L, "application and Lua core using different Lua versions"
-                  "(%d x %d)", (int)*v, (int)ver);
+    luaL_error(L, "version mismatch: app. needs %d, Lua core provides %f",
+                  ver, *v);
 }
+
-- 
cgit v1.2.3-55-g6feb