if (argument[0] == '-')
{
int len;
bool found = FALSE;
if (ch->description == NULL || ch->description[0] == '\0')
{
send_to_char ("No lines left to remove.\n\r", ch);
return;
}
strcpy (buf, ch->description);
for (len = strlen (buf); len > 0; len–)
{
if (buf[len] == '\r')
{
if (!found)
{ /* back it up */
if (len > 0)
len–;
found = TRUE;
}
else
{ /* found the second one */
buf[len + 1] = '\0';
free_string (ch->description);
ch->description = str_dup (buf);
send_to_char ("Your description is:\n\r", ch);
send_to_char (ch->description ? ch->description :
"(None).\n\r", ch);
return;
}
}
}
buf[0] = '\0';
free_string (ch->description);
ch->description = str_dup (buf);
send_to_char ("Description cleared.\n\r", ch);
return;
}
I've searched on Google and some of the Code Repositories, but I've been unable to find what I'm looking for.
Does anyone know of any codebases that support this, any snippets that may be available, or is anyone bored and feel like writing something up?
I've stared at this problem for a while and nothing is coming to me, and while I'll perhaps be able to one day handle it, I'd rather not make the fellow wait and have come seeking any help if anyone would be so kind.
I appreciate any helpful responses. Thanks :)