the original code invoked UB when len was 0, which happened on every 3rd invocation. this function gets called a couple of times, and it's the last one that transports an empty string, which then overwrites the proper "current dir". with the fallback to ".", the floppy dialog always defaults to the current dir, whereas the original code caused it to fallback to "/" - so you had to click through the entire directory structure each time.