Additional correction to make the "port" command options "use", "class",

and "index" operate on all ports with the same name.
This commit is contained in:
Tim Edwards 2020-05-28 12:30:28 -04:00
parent 626a6355ae
commit 8165519a3c
1 changed files with 28 additions and 6 deletions

View File

@ -1540,8 +1540,16 @@ CmdPort(w, cmd)
} }
else else
{ {
lab->lab_flags &= (~PORT_CLASS_MASK); for (sl = lab; sl; sl = sl->lab_next)
lab->lab_flags |= (PORT_CLASS_MASK & cmdClassToBitmask[type]); {
if (((sl->lab_flags & PORT_DIR_MASK) != 0) &&
!strcmp(sl->lab_text, lab->lab_text))
{
sl->lab_flags &= (~PORT_CLASS_MASK);
sl->lab_flags |= (PORT_CLASS_MASK &
cmdClassToBitmask[type]);
}
}
editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP); editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP);
} }
} }
@ -1577,8 +1585,15 @@ CmdPort(w, cmd)
} }
else else
{ {
lab->lab_flags &= (~PORT_USE_MASK); for (sl = lab; sl; sl = sl->lab_next)
lab->lab_flags |= (PORT_USE_MASK & cmdUseToBitmask[type]); {
if (((sl->lab_flags & PORT_DIR_MASK) != 0) &&
!strcmp(sl->lab_text, lab->lab_text))
{
sl->lab_flags &= (~PORT_USE_MASK);
sl->lab_flags |= (PORT_USE_MASK & cmdUseToBitmask[type]);
}
}
editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP); editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP);
} }
} }
@ -1602,8 +1617,15 @@ CmdPort(w, cmd)
TxError("Usage: port index <integer>\n"); TxError("Usage: port index <integer>\n");
else else
{ {
lab->lab_flags &= (~PORT_NUM_MASK); for (sl = lab; sl; sl = sl->lab_next)
lab->lab_flags |= atoi(cmd->tx_argv[argstart + 1]); {
if (((sl->lab_flags & PORT_DIR_MASK) != 0) &&
!strcmp(sl->lab_text, lab->lab_text))
{
sl->lab_flags &= (~PORT_NUM_MASK);
sl->lab_flags |= atoi(cmd->tx_argv[argstart + 1]);
}
}
editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP); editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP);
} }
} }