X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/dc738e7ae6a9c14992279dc2c52f71b14ced53aa..0a64ecd792b4caca519d597a69b8baeda6a1bf77:/methods/rsh.cc diff --git a/methods/rsh.cc b/methods/rsh.cc index 6cd618201..21f0d0a22 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: rsh.cc,v 1.6 2003/02/10 07:34:41 doogie Exp $ +// $Id: rsh.cc,v 1.6.2.1 2004/01/16 18:58:50 mdz Exp $ /* ###################################################################### RSH method - Transfer files via rsh compatible program @@ -11,7 +11,6 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include #include "rsh.h" #include @@ -23,6 +22,7 @@ #include #include #include +#include /*}}}*/ const char *Prog; @@ -110,6 +110,8 @@ bool RSHConn::Connect(string Host, string User) // Probably should do // dup2(open("/dev/null",O_RDONLY),STDERR_FILENO); + Args[i++] = Prog; + // Insert user-supplied command line options Configuration::Item const *Opts = RshOptions; if (Opts != 0) @@ -123,7 +125,6 @@ bool RSHConn::Connect(string Host, string User) } } - Args[i++] = Prog; if (User.empty() == false) { Args[i++] = "-l"; Args[i++] = User.c_str(); @@ -229,7 +230,7 @@ bool RSHConn::WriteMsg(string &Text,bool Sync,const char *Fmt,...) int Res = write(WriteFd,S + Start,Len); if (Res <= 0) { - _error->Errno("write",_("Write Error")); + _error->Errno("write",_("Write error")); Close(); return false; } @@ -261,7 +262,7 @@ bool RSHConn::Size(const char *Path,unsigned long &Size) char *End; Size = strtoul(Msg.c_str(),&End,10); if (End == Msg.c_str()) - return _error->Error(_("File Not Found")); + return _error->Error(_("File not found")); return true; } /*}}}*/ @@ -278,8 +279,7 @@ bool RSHConn::ModTime(const char *Path, time_t &Time) return false; // Parse it - StrToTime(Msg,Time); - return true; + return FTPMDTMStrToTime(Msg.c_str(), Time); } /*}}}*/ // RSHConn::Get - Get a file /*{{{*/ @@ -430,7 +430,7 @@ bool RSHMethod::Fetch(FetchItem *Itm) Server->ModTime(File,FailTime) == false) { //Fail(true); - //_error->Error(_("File Not Found")); // Will be handled by Size + //_error->Error(_("File not found")); // Will be handled by Size return false; } Res.Size = Size; @@ -511,6 +511,8 @@ bool RSHMethod::Fetch(FetchItem *Itm) int main(int argc, const char *argv[]) { + setlocale(LC_ALL, ""); + RSHMethod Mth; Prog = strrchr(argv[0],'/'); Prog++;