Comment 8 for bug 214366

Revision history for this message
In , Sspitzer (sspitzer) wrote :

a couple comments:

1) is your while loop correct?

It looks like it will generate foldernames like this:

foo1,foo12,foo123,foo1234

seems like you'd want:

foo-1,foo-2,foo-3

2) I'm not sure, but should you be using strcasecmp() instead of strcmp()?

3) ToNewCString() to get oldName and newName are wrong. what if the folder
names are in japanese? you should not be using the nsTextFormatter, you should
be using nsIStringBundle's FormatStringFromName() (or FormatStringFromID()?)

I think you can write this code without using Free() by using nsXPIDLString and
FormatStringFrom*()