* Match [Pp]assword:

* Handle failing to remove the old image in case it's not there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23510 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-01-14 02:04:42 +00:00
parent 82062f804c
commit f9f49bb963

View File

@ -93,7 +93,7 @@ SftpClient::Connect(const string& server, const string& login, const string& pas
return false;
}
fprintf(stderr, "reply: '%s'\n", reply.String());
if (reply.FindFirst("password:") < 0)
if (reply.FindFirst(/*[pP]*/"assword:") < 0)
return false;
write(OutputPipe(), passwd.c_str(), strlen(passwd.c_str()));
@ -170,6 +170,7 @@ SftpClient::MoveFile(const string& oldPath, const string& newPath)
// sftpd can't rename to an existing file...
BString cmd("rm");
cmd << " " << newPath.c_str() << "\n";
fprintf(stderr, "CMD: '%s'\n", cmd.String());
SendCommand(cmd.String());
BString reply;
@ -178,8 +179,9 @@ SftpClient::MoveFile(const string& oldPath, const string& newPath)
return false;
}
fprintf(stderr, "reply: '%s'\n", reply.String());
if (reply.FindFirst("Removing") != 0)
return false;
// we don't care if it worked or not.
//if (reply.FindFirst("Removing") != 0 && reply.FindFirst("Couldn't") )
// return false;
if ((len = ReadReply(&reply)) < 0) {
fprintf(stderr, "read: %d\n", len);