statusbar: replace getfield/optstring with luaA_getopt_string()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-26 16:05:25 +02:00
parent db07fd0362
commit 4508836133
1 changed files with 2 additions and 4 deletions

View File

@ -503,15 +503,13 @@ luaA_statusbar_new(lua_State *L)
sb->name = luaA_name_init(L); sb->name = luaA_name_init(L);
lua_getfield(L, 1, "fg"); if((buf = luaA_getopt_string(L, 1, "fg", NULL)))
if((buf = luaL_optstring(L, -1, NULL)))
xcolor_new(globalconf.connection, globalconf.default_screen, xcolor_new(globalconf.connection, globalconf.default_screen,
buf, &sb->colors.fg); buf, &sb->colors.fg);
else else
sb->colors.fg = globalconf.colors.fg; sb->colors.fg = globalconf.colors.fg;
lua_getfield(L, 1, "bg"); if((buf = luaA_getopt_string(L, 1, "bg", NULL)))
if((buf = luaL_optstring(L, -1, NULL)))
xcolor_new(globalconf.connection, globalconf.default_screen, xcolor_new(globalconf.connection, globalconf.default_screen,
buf, &sb->colors.bg); buf, &sb->colors.bg);
else else