Properly handled the yes/no argument to "cellname writeable" so that

like other commands, it accepts the usual assortment of true/false,
yes/no, 1/0.
This commit is contained in:
Tim Edwards 2021-04-22 15:39:32 -04:00
parent 6bd96a68dc
commit 56c0620417
1 changed files with 7 additions and 1 deletions

View File

@ -857,6 +857,9 @@ CmdCellname(w, cmd)
IDX_ORIENTATION, IDX_RENAME, IDX_READWRITE, IDX_ORIENTATION, IDX_RENAME, IDX_READWRITE,
IDX_MODIFIED } optionType; IDX_MODIFIED } optionType;
static char *cmdCellnameYesNo[] = {
"no", "false", "off", "0", "yes", "true", "on", "1", 0 };
if (strstr(cmd->tx_argv[0], "in")) if (strstr(cmd->tx_argv[0], "in"))
is_cellname = FALSE; is_cellname = FALSE;
else else
@ -1072,7 +1075,10 @@ CmdCellname(w, cmd)
} }
else if (locargc == 4) else if (locargc == 4)
{ {
if (tolower(*cmd->tx_argv[3 + ((dolist) ? 1 : 0)]) == 't') int subopt = Lookup(cmd->tx_argv[3 + ((dolist) ? 1 : 0)],
cmdCellnameYesNo);
if (subopt < 0) goto badusage;
else if (subopt >= 4)
{ {
/* Check if file is already read-write */ /* Check if file is already read-write */
if (!(cellDef->cd_flags & CDNOEDIT)) if (!(cellDef->cd_flags & CDNOEDIT))