diff options
author | Werner Koch <[email protected]> | 2006-04-21 12:56:40 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2006-04-21 12:56:40 +0000 |
commit | 4459fcb032268d6164ce70ab750f7b6baded9bf2 (patch) | |
tree | 8726c450d6750d110809c70cb0be27f716ab90b9 /common/miscellaneous.c | |
parent | Continued with merging. (diff) | |
download | gnupg-4459fcb032268d6164ce70ab750f7b6baded9bf2.tar.gz gnupg-4459fcb032268d6164ce70ab750f7b6baded9bf2.zip |
Still merging 1.4.3 code back
Diffstat (limited to 'common/miscellaneous.c')
-rw-r--r-- | common/miscellaneous.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/miscellaneous.c b/common/miscellaneous.c index d81213ef9..14d6f020d 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -81,6 +81,7 @@ is_file_compressed (const char *s, int *ret_rc) iobuf_t a; byte buf[4]; int i, rc = 0; + int overflow; struct magic_compress_s { size_t len; @@ -91,7 +92,7 @@ is_file_compressed (const char *s, int *ret_rc) { 4, { 0x50, 0x4b, 0x03, 0x04 } }, /* (pk)zip */ }; - if ( !s || (*s == '-' && !s[1]) || !ret_rc ) + if ( iobuf_is_pipe_filename (s) || !ret_rc ) return 0; /* We can't check stdin or no file was given */ a = iobuf_open( s ); @@ -100,7 +101,7 @@ is_file_compressed (const char *s, int *ret_rc) return 0; } - if ( iobuf_get_filelength( a ) < 4 ) { + if ( iobuf_get_filelength( a, &overflow ) < 4 && !overflow) { *ret_rc = 0; goto leave; } |