1
0
Fork 0
forked from fun/fun

Fixed the code style in *.c files to two spaces indentation and add a linter named funstx to Fun. (0.39.0)

This commit is contained in:
Johannes Findeisen 2026-03-18 20:52:00 +01:00
commit 03b2532474
237 changed files with 17550 additions and 13911 deletions

View file

@ -10,24 +10,27 @@
*/
case OP_PROC_SYSTEM: {
/* Pops command string; pushes exit code number */
Value cmdv = pop_value(vm);
char *cmd = value_to_string_alloc(&cmdv);
free_value(cmdv);
if (!cmd) {
push_value(vm, make_int(-1));
break;
}
int status = system(cmd);
int code = -1;
#ifdef __unix__
if (status == -1) code = -1;
else if (WIFEXITED(status)) code = WEXITSTATUS(status);
else code = -1;
#else
code = status;
#endif
push_value(vm, make_int(code));
free(cmd);
/* Pops command string; pushes exit code number */
Value cmdv = pop_value(vm);
char *cmd = value_to_string_alloc(&cmdv);
free_value(cmdv);
if (!cmd) {
push_value(vm, make_int(-1));
break;
}
int status = system(cmd);
int code = -1;
#ifdef __unix__
if (status == -1)
code = -1;
else if (WIFEXITED(status))
code = WEXITSTATUS(status);
else
code = -1;
#else
code = status;
#endif
push_value(vm, make_int(code));
free(cmd);
break;
}