Merging upstream version 1.2~pre3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
388270afb8
commit
57a593e0b1
32 changed files with 1172 additions and 1035 deletions
12
zcmpdiff.cc
12
zcmpdiff.cc
|
@ -15,10 +15,8 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef O_BINARY
|
||||
const int o_binary = O_BINARY;
|
||||
#else
|
||||
const int o_binary = 0;
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
struct { const char * from; const char * to; } const known_extensions[] = {
|
||||
|
@ -36,7 +34,7 @@ struct { const char * from; const char * to; } const known_extensions[] = {
|
|||
|
||||
int open_instream( const std::string & input_filename )
|
||||
{
|
||||
int infd = open( input_filename.c_str(), O_RDONLY | o_binary );
|
||||
int infd = open( input_filename.c_str(), O_RDONLY | O_BINARY );
|
||||
if( infd < 0 )
|
||||
show_error2( "Can't open input file", input_filename.c_str() );
|
||||
return infd;
|
||||
|
@ -53,13 +51,13 @@ int open_other_instream( std::string & name )
|
|||
{
|
||||
name.resize( name.size() - from.size() );
|
||||
name += known_extensions[i].to;
|
||||
return open( name.c_str(), O_RDONLY | o_binary );
|
||||
return open( name.c_str(), O_RDONLY | O_BINARY );
|
||||
}
|
||||
}
|
||||
for( int i = 0; i < num_formats; ++i )
|
||||
{ // search compressed version
|
||||
const std::string s( name + simple_extensions[format_order[i]] );
|
||||
const int infd = open( s.c_str(), O_RDONLY | o_binary );
|
||||
const int infd = open( s.c_str(), O_RDONLY | O_BINARY );
|
||||
if( infd >= 0 ) { name = s; return infd; }
|
||||
}
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue