MantisBT - opensim
View Issue Details
0003963opensim[REGION] Scripting Enginepublic2009-08-02 06:172015-03-16 12:55
Kharmen Spad 
patch feedbackopen 
Grid (1 Region per Sim)
Mono / Windows
0003963: blank variable not preserved on re-rez/restart
If a script variable is set to " ", its value will not be preserved if the object is taken to inventory then re-rezzed, or if the region in which the object is rezzed restarts, in which cases the value will be an empty string, "". This will cause scripts which use " " for unused menu buttons to fail.
Test script:
string a; string b;

    {a="a";b=" ";}
    touch_start(integer num)
    {llSay(0,"a: "+"*"+a+"*");llSay(0,"b: "+"*"+b+"*");}
No tags attached.
has duplicate 0007162new  String variables containing only spaces are reset to empty on simulator restart 
patch 0001-Avoid-removal-of-whitespace-from-LSL-strings-fixes-i.patch (1,269) 2015-03-06 16:08
Issue History
2009-08-02 06:17Kharmen SpadNew Issue
2009-08-02 06:17Kharmen SpadSVN Revision => 10108
2009-08-02 06:17Kharmen SpadRun Mode => Grid (1 Region per Sim)
2009-08-02 06:17Kharmen SpadPhysics Engine => ODE
2009-08-02 06:17Kharmen SpadEnvironment => Mono / Windows
2009-08-02 06:17Kharmen SpadMono Version => trunk
2009-08-02 06:19melanieNote Added: 0012703
2011-08-12 00:59makopoppoNote Added: 0019476
2011-08-12 00:59makopoppoStatusnew => acknowledged
2014-05-11 04:11MagnuzRelationship addedhas duplicate 0007162
2014-05-11 04:13MagnuzNote Added: 0026033
2015-03-06 16:07Shy RobbianiNote Added: 0027761
2015-03-06 16:07Shy RobbianiStatusacknowledged => patch included
2015-03-06 16:08Shy RobbianiFile Added: 0001-Avoid-removal-of-whitespace-from-LSL-strings-fixes-i.patch
2015-03-11 16:28justinccNote Added: 0027840
2015-03-11 16:28justinccAssigned To => justincc
2015-03-11 16:28justinccStatuspatch included => patch feedback
2015-03-11 16:29justinccNote Edited: 0027840bug_revision_view_page.php?bugnote_id=27840#r3889
2015-03-11 16:29justinccNote Edited: 0027840bug_revision_view_page.php?bugnote_id=27840#r3890
2015-03-16 12:55Shy RobbianiNote Added: 0027866

2009-08-02 06:19   
This is an issue with the underlying XML serialization, which appears to trim whitespace. Of course that should not be happening.
2011-08-12 00:59   
This is still an issue in OpenSim 0.7.2-dev.
2014-05-11 04:13   
This is still an issue in OpenSim 0.7.6 Release.
Shy Robbiani   
2015-03-06 16:07   
Changed handling to preserve whitespace when .state doc is loaded.

Please note, the patch does not resolve another issue where whitespace gets removed from LSL string variables when objects or attachments are rezzed from inventory.
2015-03-11 16:28   
(edited on: 2015-03-11 16:29)
Nice find though my reservation about applying this patch by itself is that it would introduce inconsistency in behaviour.

Do you have any lead on why this doesn't work for rezzed items? Perhaps a change also needs to be made in SceneObjectPartInventory.RestoreSavedScriptState()? Or could it be that whitespace is being obliterated by an HG related asset transformation such as that in HGAssetMapper.TransformXml()?

Shy Robbiani   
2015-03-16 12:55   
The reason for why this doesn't work for rezzed items is simple, it happens at another location which I haven't found yet. I will take a look at the places you mentioned as soon I find some time.

The patch here is really at the place where the white space gets removed when the XML is loaded. It's easy to debug to see what happens. The only concern I had myself was that it could have negative impact on other state attributes, but I could not find any. In other words, I cant see any reason for why the state values shouldn't be left unchanged when loaded.