Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bedtools2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
legacy
bedtools2
Commits
6fbc3c26
Commit
6fbc3c26
authored
11 years ago
by
arq5x
Browse files
Options
Downloads
Patches
Plain Diff
just peak at first bit in isGzipFile() fix for issue46
parent
dc51d7db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/fileType/fileType.cpp
+16
-9
16 additions, 9 deletions
src/utils/fileType/fileType.cpp
with
16 additions
and
9 deletions
src/utils/fileType/fileType.cpp
+
16
−
9
View file @
6fbc3c26
...
...
@@ -48,24 +48,31 @@ bool isGzipFile(istream *file) {
without triggering the "fail" bit. This was necessary to support
FIFOs, per version 2.13.0
*/
struct
{
unsigned
char
id1
;
//
struct {
//
unsigned char id1;
// unsigned char id2;
// unsigned char cm;
}
gzip_header
;
//
} gzip_header;
if
(
!
file
->
read
((
char
*
)
&
gzip_header
,
sizeof
(
gzip_header
)))
{
return
false
;
}
if
(
gzip_header
.
id1
==
0x1f
)
// if (!file->read((char*)&gzip_header, sizeof(gzip_header))) {
// return false;
// }
// if ( gzip_header.id1 == 0x1f )
// &&
// gzip_header.id2 == 0x8b
// &&
// gzip_header.cm == 8 )
/*
26-Dec-2012 and again 20-Mar-2014:
Just peek at the first byte instead of reading it so that we don't
affect the istream's failbit. This modification was wisely proposed
by John Marshall in response to Issue 30:
https://github.com/arq5x/bedtools/issues/30
*/
if
(
file
->
peek
()
!=
0x1f
)
{
return
true
;
}
file
->
putback
(
gzip_header
.
id1
);
return
false
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment