PennMUSH Community

Ticket #7331 (closed bug: fixed)

Opened 2 years ago

Last modified 1 year ago

'with' arg parsing broken when use/command locks in use

Reported by: javelin Assigned to: raevnos
Priority: major Milestone: 1.8.2p4
Keywords: Cc:
Visibility: Public

Description

Demonstration:

@create withtest
@VA withtest=$foo *: @emit You foo with %0
@set withtest = DEBUG

with withtest=foo blah
> #9849! You foo with %0 => You foo with blah
> You foo with blah

All well. Now:

@lock/Command withtest=ISWITH/1
&ISWITH withtest=strmatch(%c,with*)

with withtest=foo blah
> #9849! strmatch(%c,with*) :
> #9849!  %c => with withtest=foo blah
> #9849! strmatch(%c,with*) => 1
> #9849! You foo with %0 => You foo with  withtest=foo blah
> You foo with  withtest=foo blah

This is bad. I'm not sure how to fix yet.

Change History

05/22/07 19:34:41 changed by javelin

Raevnos points out that it's wild_match_case setting wnxt and causing this. I don't know how to fix, hopefully you will. My softcode workaround (this works):

&iswith withtest=regmatch(%c,with)

06/06/07 11:15:08 changed by raevnos

  • owner changed from devteam to raevnos.
  • milestone set to 1.8.3p3.

06/08/07 15:17:21 changed by raevnos

Okay, here's what's happening:

wild1() uses a static buffer to store what matches wildcards in a pattern. It's called once by atr_comm_match to set wnxt[0] to 'bar'. Then it's called again as a result of the strmatch(), and the buffer is recycled for that pattern and gets set to a new match, thus changing the saved one. Now to figure out a good fix...

06/08/07 18:29:28 changed by raevnos

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone changed from 1.8.3p3 to 1.8.2p4.