Perl, 48 + 3 = 51 bytes
s/\./substr($^I,$.=pos,1)||$&/ge;$_.=substr$^I,$.
Bah cannot find a shorter solution. (Same approach as @Qwertiy's JavaScript's answer):
Requires.
Requires -pl
and takes input from stdin
and -i
$ perl -i'a...ce' -ple's/\./substr($^I,$.=pos,1)||$&/ge;$_.=substr$^I,$.' <<< '..b.d..f'
a.b.de..f