ghostx2 / superputty

Automatically exported from code.google.com/p/superputty
MIT License
0 stars 0 forks source link

Wrong Path when using ".." in File Transfer Window - Leading to "no such file or directory" #247

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open up a FileTransfer to a server.
2. Click the .. Entry several Times to change Directory
3. Click any other Directory Entry

What is the expected output? What do you see instead?
Expected: Changing directories, one at a time. Get to parent Directory.
          When clicking on displayed directory: Change to that directory

Instead: Geting up more than one step / Getting no such file or directory 
Error. File Transfer tries to use wrong Path (see output below).

What version of the product are you using? On what operating system?
Tried 1.3.0.6, 1.3.0.11. Windows 7 Professional.

Please provide any additional information below.

I sometimes also get the ThreadException or Enumeration Error mentioned in 
Issues 111 and 192.

Directory Structure is like: /home/someuser

When first clicking on .., i get the list of files/directories in /home/ when 
clicking on someuser again, i get "no such file or directory" because the 
program tries to list ./../../someuser  which is /someuser and does not exist.
This also happens when changing to other directories.

2012-10-16 12:02:34,592 INFO            SuperPuTTY - Opening scp session, 
id=[TEST] Xy
2012-10-16 12:02:34,601 INFO               Program - Started new File Transfer 
Session for [TEST] Xy
2012-10-16 12:02:34,617 INFO               Program - Request directory listing 
for '[TEST] Xy/.'
2012-10-16 12:02:34,619 INFO               Program - Sending Command: 
'C:\Program Files\PuTTY\pscp.exe -ls -load "Default Settings" -pw XXXXX -P 22 
someuser@10.10.10.10:.'
2012-10-16 12:02:34,668 DEBUG           SuperPuTTY - STATUS: Opened session: 
[TEST] Xy [SCP]
2012-10-16 12:02:35,113 INFO               Program - Remote host returned 1 
File entries
2012-10-16 12:02:35,114 INFO               Program - Remote host returned 2 
File entries
                                [...]
2012-10-16 12:02:35,117 INFO               Program - Remote host returned 6 
File entries
2012-10-16 12:02:35,118 INFO               Program - Remote host returned 7 
File entries
2012-10-16 12:02:35,118 INFO               Program - Process Exited: 0
2012-10-16 12:02:35,124 INFO               Program - Remote host returned 8 
File entries
2012-10-16 12:02:35,129 INFO               Program - Remote host returned 9 
File entries
                                [...]
2012-10-16 12:02:35,139 INFO               Program - Remote host returned 20 
File entries
2012-10-16 12:02:35,139 INFO               Program - Remote host returned 21 
File entries
2012-10-16 12:02:39,146 INFO               Program - Request directory listing 
for '[TEST] Xy/./..'
2012-10-16 12:02:39,148 INFO               Program - Sending Command: 
'C:\Program Files\PuTTY\pscp.exe -ls -load "Default Settings" -pw XXXXX -P 22 
someuser@10.10.10.10:./..'
2012-10-16 12:02:39,298 INFO               Program - Request directory listing 
for '[TEST] Xy/./../..'
2012-10-16 12:02:39,694 INFO               Program - Remote host returned 1 
File entries
2012-10-16 12:02:39,696 INFO               Program - Remote host returned 2 
File entries
2012-10-16 12:02:39,699 INFO               Program - Remote host returned 3 
File entries
2012-10-16 12:02:39,709 INFO               Program - Remote host returned 4 
File entries
2012-10-16 12:02:39,702 INFO               Program - Process Exited: 0
2012-10-16 12:02:39,715 INFO               Program - Remote host returned 5 
File entries
                                [...]
2012-10-16 12:02:39,751 INFO               Program - Remote host returned 19 
File entries
2012-10-16 12:02:39,754 INFO               Program - Remote host returned 20 
File entries
2012-10-16 12:02:41,474 INFO               Program - Request directory listing 
for '[TEST] Xy/./../../someuser'
2012-10-16 12:02:41,476 INFO               Program - Sending Command: 
'C:\Program Files\PuTTY\pscp.exe -ls -load "Default Settings" -pw XXXXX -P 22 
someuser@10.10.10.10:./../../someuser'
2012-10-16 12:02:41,610 INFO               Program - Request directory listing 
for '[TEST] Xy/./../../someuser/someuser'
2012-10-16 12:02:41,914 INFO               Program - Could not parse directory 
listing entry: 
    'Unable to open ./../../someuser: no such file or directory'
2012-10-16 12:02:41,919 INFO               Program - Process Exited: 0
2012-10-16 12:03:48,797 DEBUG        frmSuperPutty - [1575936] Activated

Original issue reported on code.google.com by asga.anm...@gmail.com on 16 Oct 2012 at 10:08

GoogleCodeExporter commented 9 years ago

Original comment by btatey...@gmail.com on 20 Oct 2012 at 9:02

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I checked the code for the 1.3 Branch, the Problem seems to be that 

private void listView1_DoubleClick(object sender, EventArgs e)

Is called twice when double clicking an Entry in the File Transfer Window.

I think the reason is that the click event points to the same Method and that 
Activation is set to "OneClick"

Everything seems to be ok when you single-click on the Entries.

Only thing i don't know is where the exception that sometimes pops up, comes 
from.

Original comment by asga.anm...@gmail.com on 7 Nov 2012 at 3:52

GoogleCodeExporter commented 9 years ago
Removed the single click handler (thanks for the debugging)

Also handling ".." differently.

Original comment by btatey...@gmail.com on 25 Nov 2012 at 9:19