X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/df46a87ab6b67019277884f7ae990af26080280d..cb6020cdfea3d6dec6f6ad13843ab46f0c10d562:/cmdline/apt-helper.cc diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index 001b5e5f7..b92055ab7 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -145,14 +145,28 @@ static bool DoCatFile(CommandLine &CmdL) /*{{{*/ } if (CmdL.FileSize() <= 1) - return _error->Error("Must specify at least one file name"); + { + if (fd.OpenDescriptor(STDIN_FILENO, FileFd::ReadOnly) == false) + return false; + if (CopyFile(fd, out) == false) + return false; + return true; + } for(size_t i = 1; CmdL.FileList[i] != NULL; ++i) { std::string const name = CmdL.FileList[i]; - if (fd.Open(name, FileFd::ReadOnly, FileFd::Extension) == false) - return false; + if (name != "-") + { + if (fd.Open(name, FileFd::ReadOnly, FileFd::Extension) == false) + return false; + } + else + { + if (fd.OpenDescriptor(STDIN_FILENO, FileFd::ReadOnly) == false) + return false; + } if (CopyFile(fd, out) == false) return false;