mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 02:36:15 +01:00
cat: fix the test if the file is binary, which swallowed the first 4098 bytes
This commit is contained in:
parent
8a4f2535e7
commit
aca6c6979e
@ -1913,7 +1913,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
import tempfile
|
import tempfile
|
||||||
(fd, filename) = tempfile.mkstemp(prefix = 'osc_%s.' % args[2], dir = '/tmp')
|
(fd, filename) = tempfile.mkstemp(prefix = 'osc_%s.' % args[2], dir = '/tmp')
|
||||||
get_source_file(conf.config['apiurl'], args[0], args[1], args[2], targetfilename=filename)
|
get_source_file(conf.config['apiurl'], args[0], args[1], args[2], targetfilename=filename)
|
||||||
if binary(os.read(fd, 4098)):
|
if binary_file(filename):
|
||||||
print >>sys.stderr, 'error - cannot display binary file \'%s\'' % args[2]
|
print >>sys.stderr, 'error - cannot display binary file \'%s\'' % args[2]
|
||||||
else:
|
else:
|
||||||
print '### Beginning of file: \'%s\' ###' % filename
|
print '### Beginning of file: \'%s\' ###' % filename
|
||||||
|
Loading…
Reference in New Issue
Block a user