PennMUSH Community

Ticket #7518 (new incoming)

Opened 6 months ago

Last modified 6 months ago

Speak transform missing quotes

Reported by: anonymous Assigned to:
Priority: minor Milestone:
Keywords: Cc:
Visibility: Public

Description

Speak returns improper quotes if used with transform and multi-part speech.

Example: think [speak(me, test" and adds "test #128/f.speak)]

&F.SPEAK #128=%0 Summer says, test" and adds test < no open or close quote

&F.SPEAK #128="%0 Summer says, "test" and adds "test < no close quote

&F.SPEAK #128="%0" Summer says, "test"" and adds "test" < double quote for the first fragment

Desired output is as with 'say' Input: Say test" and adds, "test Output: Summer says, "test" and adds, "test"

Change History

12/30/07 18:39:57 changed by Alan Schwartz

Quoting Penndev (pennmush-bugs@pennmush.org):
> #7518: Speak transform missing quotes
> ---------------------------------+------------------------------------------
> Reporter:  sbaylor@dsl-only.net  |         Type:  incoming
>   Status:  new                   |     Priority:  minor   
> Keywords:                        |   Visibility:  Public  
> ---------------------------------+------------------------------------------
>  Speak returns improper quotes if used with transform and multi-part
>  speech.
> 
>  Example:
>  think [speak(me, test" and adds "test,, #128/f.speak)]

Speak is seeing:

test"and adds "test

as:

test <speech, because it's the start and has no : or ; or | prefix>
" <end of speech>
and adds <non-speech>
"test <speech fragment, delimited by double-quotes, no close delim>

A useful test case is:

&F.SPEAK #128=**%0**

Which produces:

Summer says, **test**" and adds **test**

The weird part of this behavior is the retaining of the quote
after the first speech fragment. The correct behavior should be:

Summer says, **test** and adds **test**
(Stripping the end-of-speech-fragment quote)


I think the issue is in speech.c around line 2140:

    if (end && *end) {
      if (say)
        safe_str(close, buff, bp);
    }

That close delim shouldn't be added if we're implicitly in say
mode (with no starting delimiter at the front of the string), I think.

That will require tracking a bit more state back here at line 2111:

  } else {
    /* We're in say mode and the first char isn't open, start there */
    start = string;
  }

That case probably needs to be marked and then tested for in 2140.

With that fixed, &F.SPEAK #128="%0" should do what the original
poster expects.

Hope that helps.

 - Javelin

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Javelin@M*U*S*H, once Paul@DuneMUSH | Alan Schwartz <dunemush@pennmush.org>
   (mush.pennmush.org 4201)         |     
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-