From b441d668bd11e261a61c999c6c5ab55ffcc0da5f Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 3 Aug 2024 12:05:41 -0400 Subject: [PATCH] Corrected the "property" command parsing, which had a print statement without an argument, resulting in random things getting printed to the output when a property name does not exist. --- commands/CmdCD.c | 2 +- commands/CmdLQ.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/CmdCD.c b/commands/CmdCD.c index edd80361..3f11aa62 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -1296,7 +1296,7 @@ CmdCellname(w, cmd) if (cellDef == (CellDef *) NULL) TxError("Unknown cell %s\n", cellname); else - CmdDoProperty(cellDef, cmd, 3 + ((dolist) ? 1 : 0)); + CmdDoProperty(cellDef, cmd, 2 + ((dolist) ? 1 : 0)); break; case IDX_DELETE: diff --git a/commands/CmdLQ.c b/commands/CmdLQ.c index 283d2381..bdd0e9d1 100644 --- a/commands/CmdLQ.c +++ b/commands/CmdLQ.c @@ -2326,6 +2326,7 @@ CmdDoProperty(def, cmd, argstart) /* print all properties and their values */ DBPropEnum(def, printPropertiesFunc); } + else if (locargc == 2) { /* print the value of the indicated property */ @@ -2342,7 +2343,7 @@ CmdDoProperty(def, cmd, argstart) /* just return NULL if the property was not found. */ if (strcmp(cmd->tx_argv[1], "list")) #endif - TxError("Property name %s is not defined\n"); + TxError("Property name \"%s\" is not defined\n", cmd->tx_argv[1]); } } else if (locargc == 3)