do not replace ~ a shell would not
file_translateTildeInPath currently translates the first ~ it finds. This is different from shell which only translates it if it is the first character of a word and not if other letters follow. As file_translateTildeInPath is always called with a single filename, only replace it if this string is "~" or starts with "~/". Additionally add an size argument to the function, so that no string buffers can overrun and do not access a NULL pointer if HOME is not set.
Showing with 20 additions and 23 deletions