Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Max Horn <max@quendi.de>
  • Loading branch information
ChrisJefferson and fingolfin authored Apr 15, 2020
1 parent a6fb085 commit 6c5fa79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/sysfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,11 +680,11 @@ Int SyFopen (
#endif

/* try to open the file */
if(endsgz && (syBuf[fid].gzfp = gzopen(name, mode))) {
if (endsgz && (syBuf[fid].gzfp = gzopen(name, mode))) {
syBuf[fid].type = gzip_socket;
syBuf[fid].fp = -1;
syBuf[fid].bufno = -1;
} else if ( 0 <= ( syBuf[fid].fp = open(name,flags, 0644))) {
} else if (0 <= (syBuf[fid].fp = open(name, flags, 0644))) {
syBuf[fid].type = raw_socket;
syBuf[fid].echo = syBuf[fid].fp;
syBuf[fid].bufno = -1;
Expand Down
6 changes: 3 additions & 3 deletions tst/testinstall/compressed.tst
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ gap> isGzippedFile := function(dir, name)
gap> str := "hello\ngoodbye\n";;

# Write a compressed file
gap> FileString( Filename(dir, "test.g.gz"), str ) = Length(str);
gap> FileString( fname, str ) = Length(str);
true

# Check file really is compressed
gap> isGzippedFile(dir, "test.g.gz");
true

# Check reading compressed file
gap> StringFile( Filename(dir, "test.g.gz") ) = str;
gap> StringFile( fname ) = str;
true

# Check gz is added transparently
gap> StringFile( Filename(dir, "test.g") ) = str;
true

# Test reading/seeking
# Test reading/seeking in a gzip compressed file
gap> stream := InputTextFile(fname);;
gap> ReadLine(stream);
"hello\n"
Expand Down

0 comments on commit 6c5fa79

Please sign in to comment.