1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 18:06:13 +01:00

cat: fix the test if the file is binary, which swallowed the first 4098 bytes

This commit is contained in:
Dr. Peter Poeml 2007-11-30 10:28:00 +00:00
parent 8a4f2535e7
commit aca6c6979e

View File

@ -1913,7 +1913,7 @@ class Osc(cmdln.Cmdln):
import tempfile
(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)
if binary(os.read(fd, 4098)):
if binary_file(filename):
print >>sys.stderr, 'error - cannot display binary file \'%s\'' % args[2]
else:
print '### Beginning of file: \'%s\' ###' % filename