* Like tputs but we handle $<...> delay strings here because * some implementations of tputs don't perform delays correctly. */
(str, affcnt, f_putc)
| 1617 | * some implementations of tputs don't perform delays correctly. |
| 1618 | */ |
| 1619 | static void |
| 1620 | ltputs(str, affcnt, f_putc) |
| 1621 | char *str; |
| 1622 | int affcnt; |
| 1623 | int (*f_putc)(int); |
| 1624 | { |
| 1625 | while (str != NULL && *str != '\0') |
| 1626 | { |
| 1627 | #if HAVE_STRSTR |
| 1628 | char *obrac = strstr(str, "$<"); |
| 1629 | if (obrac != NULL) |
| 1630 | { |
| 1631 | char str2[64]; |
| 1632 | int slen = obrac - str; |
| 1633 | if (slen < sizeof(str2)) |
| 1634 | { |
| 1635 | int delay; |
| 1636 | /* Output first part of string (before "$<"). */ |
| 1637 | memcpy(str2, str, slen); |
| 1638 | str2[slen] = '\0'; |
| 1639 | do_tputs(str2, affcnt, f_putc); |
| 1640 | str += slen + 2; |
| 1641 | /* Perform the delay. */ |
| 1642 | delay = lstrtoi(str, &str); |
| 1643 | if (*str == '*') |
| 1644 | delay *= affcnt; |
| 1645 | flush(); |
| 1646 | sleep_ms(delay); |
| 1647 | /* Skip past closing ">" at end of delay string. */ |
| 1648 | str = strstr(str, ">"); |
| 1649 | if (str != NULL) |
| 1650 | str++; |
| 1651 | continue; |
| 1652 | } |
| 1653 | } |
| 1654 | #endif |
| 1655 | /* Pass the rest of the string to tputs and we're done. */ |
| 1656 | do_tputs(str, affcnt, f_putc); |
| 1657 | break; |
| 1658 | } |
| 1659 | } |
| 1660 | #endif /* MSDOS_COMPILER */ |
| 1661 | |
| 1662 | /* |
no test coverage detected
searching dependent graphs…