diff --git a/doc/imapfilter.1 b/doc/imapfilter.1 index ff66c37..f6e3f73 100644 --- a/doc/imapfilter.1 +++ b/doc/imapfilter.1 @@ -24,7 +24,7 @@ The command line options of are as follows: .Bl -tag -width Ds .It Fl c Ar configfile -Path to the configuration file. The default is +Path to the configuration file, or - to read from stdin. The default is .Pa $HOME/.imapfilter/config.lua . .It Fl d Ar debugfile File that contains debugging information about the full communication with the diff --git a/src/lua.c b/src/lua.c index 795be55..e97ee1d 100644 --- a/src/lua.c +++ b/src/lua.c @@ -78,7 +78,7 @@ start_lua() "=") || lua_pcall(lua, 0, LUA_MULTRET, 0)) fatal(ERROR_CONFIG, "%s\n", lua_tostring(lua, -1)); } else { - if (luaL_loadfile(lua, opts.config)) + if (luaL_loadfile(lua, strcmp(opts.config, "-") == 0 ? NULL : opts.config)) fatal(ERROR_CONFIG, "%s\n", lua_tostring(lua, -1)); lua_pushcfunction(lua, traceback_handler); lua_insert(lua, 1);