From e9844a4f1d8a4cb9642c00db552a40f65f3748b8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 28 May 2004 15:32:51 -0300 Subject: [PATCH] `popen' is not ANSI and therefore was removed from the basic library --- liolib.c | 22 +--------------------- luaconf.h | 12 +----------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/liolib.c b/liolib.c index 916e5575..27f388ed 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.50 2004/04/30 20:13:38 roberto Exp roberto $ +** $Id: liolib.c,v 2.51 2004/05/10 20:26:37 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -30,11 +30,6 @@ */ -#if !USE_POPEN -#define pclose(f) (-1) -#endif - - #define FILEHANDLE "FILE*" #define IO_INPUT 1 @@ -148,20 +143,6 @@ static int io_open (lua_State *L) { } -static int io_popen (lua_State *L) { -#if !USE_POPEN - luaL_error(L, "`popen' not supported"); - return 0; -#else - const char *filename = luaL_checkstring(L, 1); - const char *mode = luaL_optstring(L, 2, "r"); - FILE **pf = newfile(L); - *pf = popen(filename, mode); - return (*pf == NULL) ? pushresult(L, 0, filename) : 1; -#endif -} - - static int io_tmpfile (lua_State *L) { FILE **pf = newfile(L); *pf = tmpfile(); @@ -456,7 +437,6 @@ static const luaL_reg iolib[] = { {"close", io_close}, {"flush", io_flush}, {"open", io_open}, - {"popen", io_popen}, {"read", io_read}, {"tmpfile", io_tmpfile}, {"type", io_type}, diff --git a/luaconf.h b/luaconf.h index ebf4d170..7fb2f843 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.2 2004/05/10 13:58:26 roberto Exp roberto $ +** $Id: luaconf.h,v 1.3 2004/05/10 17:50:51 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -258,16 +258,6 @@ #endif -/* -** by default, posix systems get `popen' -*/ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2 -#define USE_POPEN 1 -#else -#define USE_POPEN 0 -#endif - - #endif