Macro cleanup: HAVE_SANDBOX

This commit is contained in:
Michael Reed
2015-02-03 20:07:00 -05:00
committed by Justin M. Keyes
parent 0dd1ad0760
commit 357583ff8c
8 changed files with 17 additions and 53 deletions

View File

@@ -1093,9 +1093,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
int save_msg_scroll = msg_scroll;
int save_msg_silent = -1;
int did_esilent = 0;
#ifdef HAVE_SANDBOX
int did_sandbox = FALSE;
#endif
cmdmod_T save_cmdmod;
int ni; /* set when Not Implemented */
@@ -1240,11 +1238,9 @@ static char_u * do_one_cmd(char_u **cmdlinep,
continue;
case 's': if (checkforcmd(&ea.cmd, "sandbox", 3)) {
#ifdef HAVE_SANDBOX
if (!did_sandbox)
++sandbox;
did_sandbox = TRUE;
#endif
continue;
}
if (!checkforcmd(&ea.cmd, "silent", 3))
@@ -1509,13 +1505,11 @@ static char_u * do_one_cmd(char_u **cmdlinep,
}
if (!ea.skip) {
#ifdef HAVE_SANDBOX
if (sandbox != 0 && !(ea.argt & SBOXOK)) {
/* Command not allowed in sandbox. */
errormsg = (char_u *)_(e_sandbox);
goto doend;
}
#endif
if (!curbuf->b_p_ma && (ea.argt & MODIFY)) {
/* Command not allowed in non-'modifiable' buffer */
errormsg = (char_u *)_(e_modifiable);
@@ -1983,10 +1977,8 @@ doend:
msg_col = 0;
}
#ifdef HAVE_SANDBOX
if (did_sandbox)
--sandbox;
#endif
if (ea.nextcmd && *ea.nextcmd == NUL) /* not really a next command */
ea.nextcmd = NULL;