~ubuntu-branches/debian/experimental/apt/experimental

« back to all changes in this revision

Viewing changes to ftparchive/multicompress.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2010-02-18 22:07:23 UTC
  • mfrom: (9.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100218220723-zb7zdh6fmsmp30tr
Tags: 0.7.26~exp2
fix crash when LANGUAGE is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include "multicompress.h"
18
18
    
19
19
#include <apti18n.h>
20
 
#include <apt-pkg/contrib/strutl.h>
21
 
#include <apt-pkg/contrib/error.h>
22
 
#include <apt-pkg/contrib/md5.h>
 
20
#include <apt-pkg/strutl.h>
 
21
#include <apt-pkg/error.h>
 
22
#include <apt-pkg/md5.h>
23
23
    
24
24
#include <sys/types.h>
25
25
#include <sys/stat.h>
40
40
// MultiCompress::MultiCompress - Constructor                           /*{{{*/
41
41
// ---------------------------------------------------------------------
42
42
/* Setup the file outputs, compression modes and fork the writer child */
43
 
MultiCompress::MultiCompress(string Output,string Compress,
44
 
                             mode_t Permissions,bool Write)
 
43
MultiCompress::MultiCompress(string const &Output,string const &Compress,
 
44
                             mode_t const &Permissions,bool const &Write) :
 
45
                        Permissions(Permissions)
45
46
{
46
47
   Outputs = 0;
47
48
   Outputter = -1;
48
49
   Input = 0;
49
50
   UpdateMTime = 0;
50
 
   this->Permissions = Permissions;
51
51
   
52
52
   /* Parse the compression string, a space separated lists of compresison
53
53
      types */
126
126
/* This checks each compressed file to make sure it exists and returns
127
127
   stat information for a random file from the collection. False means
128
128
   one or more of the files is missing. */
129
 
bool MultiCompress::GetStat(string Output,string Compress,struct stat &St)
 
129
bool MultiCompress::GetStat(string const &Output,string const &Compress,struct stat &St)
130
130
{
131
131
   /* Parse the compression string, a space separated lists of compresison
132
132
      types */
268
268
/* This opens the compressor, either in compress mode or decompress 
269
269
   mode. FileFd is always the compressor input/output file, 
270
270
   OutFd is the created pipe, Input for Compress, Output for Decompress. */
271
 
bool MultiCompress::OpenCompress(const CompType *Prog,pid_t &Pid,int FileFd,
272
 
                                 int &OutFd,bool Comp)
 
271
bool MultiCompress::OpenCompress(const CompType *Prog,pid_t &Pid,int const &FileFd,
 
272
                                 int &OutFd,bool const &Comp)
273
273
{
274
274
   Pid = -1;
275
275
   
365
365
// MultiCompress::Child - The writer child                              /*{{{*/
366
366
// ---------------------------------------------------------------------
367
367
/* The child process forks a bunch of compression children and takes 
368
 
   input on FD and passes it to all the compressor childer. On the way it
 
368
   input on FD and passes it to all the compressor child. On the way it
369
369
   computes the MD5 of the raw data. After this the raw data in the 
370
370
   original files is compared to see if this data is new. If the data
371
371
   is new then the temp files are renamed, otherwise they are erased. */
372
 
bool MultiCompress::Child(int FD)
 
372
bool MultiCompress::Child(int const &FD)
373
373
{
374
374
   // Start the compression children.
375
375
   for (Files *I = Outputs; I != 0; I = I->Next)