Skip to content
Snippets Groups Projects
Commit b5bae060 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

lua: do not crash interactive session on blank line

parent 4b5dbc74
No related branches found
No related tags found
No related merge requests found
......@@ -206,11 +206,11 @@ void binding::interactiveSession()
#ifdef HAVE_READLINE
using_history();
while (const char *line=readline("lua> ")){
char *expansion;
char *expansion=NULL;
int r=history_expand((char*)line,&expansion);
if(r)
std::cout<<expansion<<"\n";
if(r==0 || r==1){
if((r==0 || r==1)&& expansion){
add_history(expansion);
reportErrors(L, luaL_dostring(L, expansion));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment