rejetto forum
Software => HFS ~ HTTP File Server => Bug reports => Topic started by: raybob on March 19, 2012, 04:40:56 AM
-
Constant use of {.set account|n|notes key=a=b.} seems to fill up the user notes with huge amounts of whitespace.
Can someone else see if this happens to them also?
-
Yea i checked that and experienced the same problem, for every call a whitespace is added,
You can trim all the existing out by using
{.set account|$1|notes={.decodeuri|{.replace|%0A%0D||{.encodeuri|{.trim|{.get account|$1|notes.}.}.}.}.}.}
and to avoid it u have to set the entire notes again, but trimmed
ieither by adding a line after every call or adding an alias and using it instead , like :
[special:alias|private]
addnote={.set account|$1|notes key=$2=$3.}{.set account|$1|notes={.trim|{.get account|$1|notes.}.}.}
-
Very nice!! That works perfectly for removing whitespace.
I just put it in my sign in and sign out scripts so it's done once in a while for each account and will keep hfs.ini from expanding exponentially.
I created my own ^notes function which is simpler to use and put your function in there so that my notes are always nice and tidy ;)
-
the bug is clearly in this line
replace(s, val, i, findEOL(s,i));
in file utillib.pas:2740
sadly i cannot compile HFS at the moment, i will just put this in the to-do list.
-
Glad you figured it out. Here's the function I'm using:
{.set|notes|{:{.if|$3|{:{.set account|$1|notes key=$2=$3.}{.set account|$1|notes={.decodeuri|{.replace|%0A%0D||{.encodeuri|{.trim|{.get account|$1|notes.}.}.}.}.}.}:}.}{.if|{.and|$2|{.not|$3.}|{.not|$4.}.}|{:{.get account|$1|notes key=$2.}:}.}{.if|{.and|$2|{.not|$3.}|$4.}|{:{.set account|$1|notes={.decodeuri|{.replace|%0A%0D||{.encodeuri|{.trim|{.replace|$2={.^notes|$1|$2.}||{.get account|$1|notes.}.}.}.}.}.}.}:}.}:}.}
{.^notes|username|key.} expands to its value
{.^notes|username|key|value.} writes a new value
{.^notes|username|key||true.} erases the key
-
fixed in #280