From 56c0620417eb555a420304fa008b5afc5dfa80fd Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Thu, 22 Apr 2021 15:39:32 -0400 Subject: [PATCH] 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. --- commands/CmdCD.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/CmdCD.c b/commands/CmdCD.c index 0288f8e0..f4034a54 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -857,6 +857,9 @@ CmdCellname(w, cmd) IDX_ORIENTATION, IDX_RENAME, IDX_READWRITE, IDX_MODIFIED } optionType; + static char *cmdCellnameYesNo[] = { + "no", "false", "off", "0", "yes", "true", "on", "1", 0 }; + if (strstr(cmd->tx_argv[0], "in")) is_cellname = FALSE; else @@ -1072,7 +1075,10 @@ CmdCellname(w, cmd) } 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 */ if (!(cellDef->cd_flags & CDNOEDIT))