Hmm yes, that would of course work, but it's not really good either
I hate it when a program tries to be smarter than me and modifies the paths or names that I enter, that's no good thing. For example, someone might have all paths end in a backslash on purpose because he wants to concatenate them... or whatever (something like
$path$file).
The problem with computers being "smart" and tampering with the things you enter is that computers are never
really smart, so for every case you fix, there's one case where it breaks something else.
I'm not sure what is best to do
It's like when I come from the supermarket and drive up the little hill in front of my house. As there is a gentle slope going down for about 1.5 kilometers followed by a 100 m steep hill, the hybrid engine will have collected enough energy so I can drive the entire distance without spending a single drop of fuel. However, if I only push the accelerator a bit too strong, the computer in all its smartness figures that I'm going on a mountain rallye, so it fires up the combustion engine for "max power". If the computer was really smart, it would realize that I'm 100 meters from home, and that it really doesn't matter whether I get there 0.75 seconds earlier or not.