srogue: add support for SAVEDIR

This commit is contained in:
John "Elwin" Edwards 2010-11-25 17:28:29 +00:00
parent ce4b930551
commit 20d469d64f
5 changed files with 91 additions and 22 deletions

View file

@ -185,6 +185,9 @@ char *str;
continue;
len = sp - str;
for (op = optlist; op < &optlist[NUM_OPTS]; op++) {
/* For security, some options can't be changed. */
if (!allowchange(op))
continue;
if (EQSTR(str, op->o_name, len)) {
reg char *start;
@ -228,3 +231,14 @@ int len;
}
*s1 = '\0';
}
int allowchange(OPTION *opt)
{
if (!use_savedir)
return 1;
if (!strcmp(opt->o_name, "name"))
return 0;
if (!strcmp(opt->o_name, "file"))
return 0;
return 1;
}