lua: don't use "output" as identifier

I suspect this clashes with libcs,w hich define "stdout" as macro.
Hopefully fixes #1206.
This commit is contained in:
wm4 2014-10-21 13:44:21 +02:00
parent bc1893e036
commit bd315dfaf9
1 changed files with 4 additions and 4 deletions

View File

@ -1206,7 +1206,7 @@ static int script_subprocess(lua_State *L)
posix_spawn_file_actions_t fa; posix_spawn_file_actions_t fa;
bool fa_destroy = false; bool fa_destroy = false;
bstr stdout = {0}; bstr output = {0};
int status = -1; int status = -1;
int pipes[2] = {-1, -1}; int pipes[2] = {-1, -1};
pid_t pid = -1; pid_t pid = -1;
@ -1247,12 +1247,12 @@ static int script_subprocess(lua_State *L)
if (r < 0 && errno == EINTR) if (r < 0 && errno == EINTR)
continue; continue;
if (r > 0) if (r > 0)
bstr_xappend(tmp, &stdout, (bstr){buf, r}); bstr_xappend(tmp, &output, (bstr){buf, r});
eof = r == 0; eof = r == 0;
if (r <= 0) if (r <= 0)
break; break;
} }
if (stdout.len >= max_size) if (output.len >= max_size)
break; break;
} }
@ -1286,7 +1286,7 @@ done:
} }
lua_pushinteger(L, status); // res s lua_pushinteger(L, status); // res s
lua_setfield(L, -2, "status"); // res lua_setfield(L, -2, "status"); // res
lua_pushlstring(L, stdout.start, stdout.len); // res d lua_pushlstring(L, output.start, output.len); // res d
lua_setfield(L, -2, "stdout"); // res lua_setfield(L, -2, "stdout"); // res
return 1; return 1;
} }