Roland Mainz wrote:

>David.Comay at Sun.COM wrote:
>[snip]
>  
>
>>usr/src/lib/libc/port/regex/wordexp.c
>>    
>>
>
>General note for this file: The new implementation for |workexp()| is a
>"clone" of the original Solaris |wordexp()| implementation (and
>therefore shares lots of coding+style issues) - I copied the whole
>function and only did some minor modifications (e.g. old Solaris ksh
>uses a secret "switch" to do the word expansion while the new code
>passes a small mini-script to ksh93). I would really prefer to do only
>minor changes to this function since testing the changes is
>compliciated+risky and I'd like to keep the code in a state where we can
>compare it against the original version
>

That's why I think it is a very good idea (and probably should be
mandated, but that's another argument) to add tests for any piece of
legacy code that is to be modified.  These enable the maintainer to a)
document and b) understand the behaviour of the code to be changed.

Once these have been written the original code may be refactored with a
greater degree of confidence before the code's behaviour is modified.

Ian


Reply via email to