diff options
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_proto.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c index a7716d9b19..1f1e320cc9 100644 --- a/epan/wslua/wslua_proto.c +++ b/epan/wslua/wslua_proto.c @@ -305,18 +305,18 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) { luaL_error(L,"a preference named %s exists already",name); return 0; } - /* + /* * Make sure that only lower-case ASCII letters, numbers, * underscores, and dots appear in the preference name. - */ - for (c = name; *c != '\0'; c++) { - if (!isascii((guchar)*c) || - (!islower((guchar)*c) && !isdigit((guchar)*c) && *c != '_' && *c != '.')) - { - luaL_error(L,"illegal preference name \"%s\", only lower-case ASCII letters, numbers, underscores and dots may be used",name); - return 0; + */ + for (c = name; *c != '\0'; c++) { + if (!isascii((guchar)*c) || + (!islower((guchar)*c) && !isdigit((guchar)*c) && *c != '_' && *c != '.')) + { + luaL_error(L,"illegal preference name \"%s\", only lower-case ASCII letters, numbers, underscores and dots may be used",name); + return 0; + } } - } if ( ! p->next) { p->next = pref; @@ -400,6 +400,11 @@ WSLUA_METAMETHOD Prefs__index(lua_State* L) { if (! ( name && prefs_p ) ) return 0; + if (!prefs_p->next) { + luaL_error(L,"No preference is registered yet"); + return 0; + } + prefs_p = prefs_p->next; do { |