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.
This commit is contained in:
Tim Edwards 2024-08-03 12:05:41 -04:00
parent 81b5ac2079
commit b441d668bd
2 changed files with 3 additions and 2 deletions

View File

@ -1296,7 +1296,7 @@ CmdCellname(w, cmd)
if (cellDef == (CellDef *) NULL) if (cellDef == (CellDef *) NULL)
TxError("Unknown cell %s\n", cellname); TxError("Unknown cell %s\n", cellname);
else else
CmdDoProperty(cellDef, cmd, 3 + ((dolist) ? 1 : 0)); CmdDoProperty(cellDef, cmd, 2 + ((dolist) ? 1 : 0));
break; break;
case IDX_DELETE: case IDX_DELETE:

View File

@ -2326,6 +2326,7 @@ CmdDoProperty(def, cmd, argstart)
/* print all properties and their values */ /* print all properties and their values */
DBPropEnum(def, printPropertiesFunc); DBPropEnum(def, printPropertiesFunc);
} }
else if (locargc == 2) else if (locargc == 2)
{ {
/* print the value of the indicated property */ /* print the value of the indicated property */
@ -2342,7 +2343,7 @@ CmdDoProperty(def, cmd, argstart)
/* just return NULL if the property was not found. */ /* just return NULL if the property was not found. */
if (strcmp(cmd->tx_argv[1], "list")) if (strcmp(cmd->tx_argv[1], "list"))
#endif #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) else if (locargc == 3)