Sorry George, but I had to go to bed I let you do the merge if needed.

So, thanks for reporting that. The fix is as simple as adding a m to the regex which tests for existence of the key I've committed it, so you can grab the patch at the bottom of this bug report, but I doubt we will ever release it. It's fixed on trunk and Release01x01.

Closing this bug... Putting it in waiting for release, and I'm sure Kenneth will hate that, but what else should I do?

Actually the fix makes it worse. The ongoing duplication is resolved, but the update now changes only the first instance. But when the config is read by Foswiki, it's the last instance that is used. Changing the regex to /msg will change all occurrences to prevent inconsistencies.

Looks good. I took one of the LocalSite.cfg files with all the dups in it, and the script reduced it appropriately. I then copied my saved good LocalSite.cfg and ran it through the saving config again. Also looks good. A few lines in different order, but that's it.

Lavr, I've committed this "fixup" to 1.1 as well. If corrupted configs with duplicate entries slip through, the latest regex will result in configure not saving changes. This is safer, though a bit more overhead on save.