From e25883f80bdfce0a1020fc473563302679801f06 Mon Sep 17 00:00:00 2001 From: jacob Date: Sun, 22 Oct 2006 20:19:55 +0000 Subject: [PATCH] Spotted by Tim Kosse: we were returning an incorrect path in canonify() when we couldn't get any sense out of the server. git-svn-id: svn://svn.tartarus.org/sgt/putty@6877 cda61777-01e9-0310-a592-d414129be87e --- psftp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/psftp.c b/psftp.c index d07ee8b0..f77a88ed 100644 --- a/psftp.c +++ b/psftp.c @@ -128,8 +128,12 @@ char *canonify(char *name) assert(rreq == req); canonname = fxp_realpath_recv(pktin, rreq); - if (!canonname) - return fullname; /* even that failed; give up */ + if (!canonname) { + /* Even that failed. Restore our best guess at the + * constructed filename and give up */ + fullname[i] = '/'; /* restore slash and last component */ + return fullname; + } /* * We have a canonical name for all but the last path -- 2.11.0