Then that is probably also the cause for issue<div><br></div><div><a href="http://trac.osgeo.org/mapserver/ticket/3983">http://trac.osgeo.org/mapserver/ticket/3983</a></div><div><br></div><div>where unfortunately there seem to be also a segfault.<br>
<br>Umberto<br><br><div class="gmail_quote">On Wed, Feb 22, 2012 at 2:01 AM, Lime, Steve D (DNR) <span dir="ltr"><<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">In 6.0 class->text is a true expressionObj, not a string as in previous versions so at least via SWIG setText() calls msLoadExpressionString(). I think there could be a bug in that
function at line 2169 (in trunk). Older versions of that function treat the input string as a the expression if parsing doesn't detect a delimited type. So does this version but in a different way:<br>
<br>
// trunk<br>
exp->type = MS_STRING;<br>
exp->string = msStrdup(msyystring_buffer);<br>
<br>
// 5.6 branch<br>
exp->type = MS_STRING;<br>
if((strlen(value) - strlen(msyytext)) == 2)<br>
exp->string = strdup(msyytext); /* value was quoted */<br>
else<br>
exp->string = strdup(value); /* use the whole value */<br>
<br>
I've got a feeling this has to do with escaping quotes where msyystring_buffer contains the escaped text. Perhaps we could do something like:<br>
<br>
exp->type = MS_STRING;<br>
if(... if first char in value is not a single or double quote ...)<br>
exp->string = strdup(value); /* use the whole value */<br>
else<br>
exp->string = msStrdup(msyystring_buffer);<br>
<br>
Alan, does this make sense or is there another way to know that escaping was processed?<br>
<br>
Steve<br>
<br>
<div style="font-size:16px;font-family:Times New Roman">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> <a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a> [<a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a>] on behalf of Tamas Szekeres [<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>]<br>
<b>Sent:</b> Tuesday, February 21, 2012 4:09 PM<br>
<b>To:</b> <a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
<b>Subject:</b> [mapserver-dev] classObj.setText, text must be quoted<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>Hi Devs,
<div><br>
</div>
<div>By using the following mapscript example:</div>
<div><br>
</div>
<div>
<div> <i>// creating a new map from scratch</i></div>
<div><i> mapObj map = new mapObj(null);</i></div>
<div><i> // adding a layer</i></div>
<div><i> layerObj layer = new layerObj(map);</i></div>
<div><i> // define the class</i></div>
<div><i> classObj classobj = new classObj(layer);</i></div>
<div><i><span style="white-space:pre-wrap"></span> classobj.setText("Sample Text");</i></div>
<div><i> Console.WriteLine("Sample Text -> " + classobj.getTextString());</i></div>
<div><i><span style="white-space:pre-wrap"></span> classobj.setText("Sample T");</i></div>
<div><i> Console.WriteLine("Sample T -> " + classobj.getTextString());</i></div>
<div><i><span style="white-space:pre-wrap"></span> classobj.setText("\"Sample T\"");</i></div>
<div><i> Console.WriteLine("\"Sample T\" -> " + classobj.getTextString());</i></div>
</div>
<div><br>
</div>
<div>I got the following output (from trunk):</div>
<div><br>
</div>
<div>
<div>Sample Text -> "Sample Text"</div>
<div>Sample T -> "Sample"</div>
<div>"Sample T" -> "Sample T"</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>6.0 branch produces this:</div>
<div><br>
</div>
<div>
<div>Sample Text -> "Sample"</div>
<div>Sample T -> "Sample"</div>
<div>"Sample T" -> "Sample T"</div>
</div>
<div><br>
</div>
<div>Do we have a requirement that the texts must be quoted which is passed to <i>classobj.setText?</i></div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Tamas</div>
<div><br>
</div>
</div>
</div></div></div>
</div>
</div>
<br>_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
<br></blockquote></div><br></div>