Forum OpenACS Development: Re: empty_string_p obsolete?

Collapse
Posted by Gustaf Neumann on
well, replacing the occurrences is not completely trivial since the substitution can not be made blindly and requires some context knowledge. If there is e.g. "if [empty_string_p $string] {...}" then the substitution to "if $string eq "" {...}" is invalid. Furthermore, if the old code is "func [empty_string_p $string]", we have the same problem. It is worth while to replace the [string equal $a b] as well. Here it is e.g. necessary to quote literal b, otherwise the resulting code is invalid. There are a few more nasty cases...

i wrote a little program for this update that alters the files and makes backup files. if i run it over my installation i get 8197 changes in 1590 files. oacs+dotlrn start up after this change, and some random clicking around seems to work. However it is highly probable, that the change will break some code. It would be nice to have a regression test suite for such cases which succeeds on all tests in cvs, then this change could be done quite fast.... i will do some more testing and make then the program available. If there is interest, i can alter the cvs head version.