Skip to content
Snippets Groups Projects
Commit 35f326b8 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

strtoattr() now ignores Ctrl-A chars in the string... as attrstr() used to

This returns bug-compatibility with attrstr(), at least for Ctrl-A chars,
so that if someone is for example, assigning a Ctrl-A sequence to JS
console.attributes, that'll work (again) as it did in SBBS v3.19.

Any other invalid chars in the string will stop the parsing, still, even
though that's not how attrstr() worked.

For Kirkman's doorgame/script backward compatibility.
parent ad9ab307
No related branches found
No related tags found
No related merge requests found
Pipeline #8696 passed
......@@ -778,6 +778,7 @@ char *u32toaf(uint32_t l, char *str)
/****************************************************************************/
/* Returns the actual attribute code from a string of ATTR characters */
/* Ignores any Ctrl-A characters in the string (as attrstr() used to) */
/****************************************************************************/
uint strtoattr(const char *str, char** endptr)
{
......@@ -787,6 +788,8 @@ uint strtoattr(const char *str, char** endptr)
atr = LIGHTGRAY;
while (str[l]) {
switch (toupper(str[l])) {
case CTRL_A:
break;
case 'H': /* High intensity */
atr |= HIGH;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment