fix runtime error on Windows when cutting string in gBasename