fixed bug in checking file name length.
bug prevented copying deep directory structures