Lines Matching refs:cmd
985 match_address_p(cmd, input) in match_address_p() argument
986 struct sed_cmd *cmd; in match_address_p()
989 if (!cmd->a1)
992 if (cmd->range_state != RANGE_ACTIVE)
997 if (cmd->a1->addr_type == ADDR_IS_NUM)
999 if (!cmd->a2)
1000 return (input->line_number == cmd->a1->addr_number);
1002 if (cmd->range_state == RANGE_CLOSED
1003 || input->line_number < cmd->a1->addr_number)
1008 if (!cmd->a2)
1009 return match_an_address_p(cmd->a1, input);
1011 if (!match_an_address_p(cmd->a1, input))
1016 cmd->range_state = RANGE_ACTIVE;
1017 switch (cmd->a2->addr_type)
1024 if (input->line_number >= cmd->a2->addr_number)
1025 cmd->range_state = RANGE_CLOSED;
1028 cmd->a2->addr_number = input->line_number + cmd->a2->addr_step;
1031 cmd->a2->addr_number = input->line_number + cmd->a2->addr_step
1032 - (input->line_number%cmd->a2->addr_step);
1042 if (cmd->a2->addr_type == ADDR_IS_NUM)
1048 if (input->line_number >= cmd->a2->addr_number)
1049 cmd->range_state = RANGE_CLOSED;
1051 return (input->line_number <= cmd->a2->addr_number);
1055 if (match_an_address_p(cmd->a2, input))
1056 cmd->range_state = RANGE_CLOSED;
1345 switch (cur_cmd->cmd)
1369 if (p->cmd != '#')
1374 if (p->cmd != '#')
1399 switch (cur_cmd->cmd)
1758 panic("INTERNAL ERROR: Bad cmd %c", cur_cmd->cmd);
1792 if (cur_cmd->cmd == 'b' || cur_cmd->cmd == 't'
1793 || cur_cmd->cmd == 'T' || cur_cmd->cmd == '}')
1796 cur_cmd->cmd = '#'; /* replace with no-op */