MEGA65 / mega65-tools

Tools and Utilities for the MEGA65 Retro Computers
GNU General Public License v3.0
28 stars 31 forks source link

(WINDOWS) mega65_ftp adds invalid root directory changes to the current directory path #111

Closed mindrail closed 1 year ago

mindrail commented 2 years ago

When you try to change to an invalid directory by prepending / it actually changes you to an invalid directory.

Examples below:

MEGA65 SD-Card:/> cd /hello ERROR: Could not find directory segment 'hello' ERROR: Could not open directory '/hello' MEGA65 SD-Card:/hello> dir ERROR: Could not find directory segment 'hello' 0 Dir(s), 0 File(s) MEGA65 SD-Card:/hello> cd /should/not/change/path/if/the/path/doesnt/exist ERROR: Could not find directory segment 'should' ERROR: Could not open directory '/should/not/change/path/if/the/path/doesnt/exist' MEGA65 SD-Card:/should/not/change/path/if/the/path/doesnt/exist> dir ERROR: Could not find directory segment 'should' 0 Dir(s), 0 File(s) MEGA65 SD-Card:/should/not/change/path/if/the/path/doesnt/exist> cd / MEGA65 SD-Card:/> dir *.ROM 131072 | 2022-05-12 02:07:40 | MEGA65.ROM | 131072 | 2022-05-06 20:39:56 | MEGA651.ROM | 131072 | 2022-05-06 20:39:56 | MEGA652.ROM | 131072 | 2022-05-12 02:06:40 | MEGA653.ROM | 0 Dir(s), 4 File(s) MEGA65 SD-Card:/>

Behavior should mirror what happens if you normally try to change to an invalid directory:

MEGA65 SD-Card:/> cd poo ERROR: Could not find directory segment 'poo' ERROR: Could not open directory '/poo' MEGA65 SD-Card:/>

lydon42 commented 1 year ago

happens only with leading slash

lydon42 commented 1 year ago

should be fixed, please check with latest version