[Kst] Re: branches/work/kst/portto4/kst/src/libkst

Nicolas Brisset nicolas.brisset at free.fr
Sun Feb 6 10:30:40 CET 2011


> I would fix a buggy string:
> 
>        if (units.startsWith("[")) {
>          label += " " + units;
> +        if (!label.endsWith("]")) {
> +          label += "\\]";
> +        }
> 
> 
> But should I add "]" or "\\]"?
Yes, OK, I also thought about that and decided that there would either be two brackets (at the beginning and the end), or none. But your approach is better, and easy enough.
Do it, escaping the square brackets otherwise the label parser looks for a named object (scalar, etc...).

Nicolas


More information about the Kst mailing list