1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-05-19 09:02:22 +02:00

* fileutil.c (is_file_compressed): Fix the check for the "-" file

name.
This commit is contained in:
Werner Koch 2003-05-21 08:40:18 +00:00
parent d5afcca57f
commit 905e6b2528
3 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2003-05-21 Werner Koch <wk@gnupg.org>
* fileutil.c (is_file_compressed): Fix the check for the "-" file
name.
2003-03-23 David Shaw <dshaw@jabberwocky.com>
* argparse.c (default_strusage): Change copyright date.

View File

@ -1,5 +1,5 @@
/* fileutil.c - file utilities
* Copyright (C) 1998 Free Software Foundation, Inc.
* Copyright (C) 1998, 2003 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -205,7 +205,7 @@ is_file_compressed( const char *s, int *ret_rc )
{ 4, { 0x50, 0x4b, 0x03, 0x04 } }, /* (pk)zip */
};
if ( !s || *s == '-' || !ret_rc )
if ( !s || (*s == '-' && !s[1]) || !ret_rc )
return 0; /* We can't check stdin or no file was given */
a = iobuf_open( s );

View File

@ -1834,13 +1834,14 @@ iobuf_set_limit( IOBUF a, off_t nlimit )
/****************
* Return the length of an open file
/*
* Return the length of an open file.
*/
off_t
iobuf_get_filelength( IOBUF a )
{
struct stat st;
const char *s;
if( a->directfp ) {
FILE *fp = a->directfp;