Mailinglist Archive: opensuse-buildservice (351 mails)

< Previous Next >
Re: [opensuse-buildservice] osc submitreq accept broken
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Tue, 15 Jul 2008 12:18:21 +0200
  • Message-id: <20080715101821.GA13393@xxxxxxx>
On Mon, Jul 14, 2008 at 11:33:23PM +0200, Dirk Mueller wrote:
On Monday 14 July 2008, Dirk Mueller wrote:

hmm, even worse, it seems the src repository is now corrupted. from a fresh
checkout:

there are two more bugs in isascii() which might have caused that:

- it read 0 bytes of the file at offset 4096 instead of 4096 bytes from
offset 0
- a file containing a newline \r or \n was considered to be binary.

anyway, I think it might be better to just use the perl builtin operator -T
for it (and all the other possible bugs still lurking in 5 lines of perl).

@@ -1650,12 +1650,7 @@ sub sourcediff {

sub isascii {
my ($file) = @_;
- local *F;
- open(F, '<', $file) || die("$file: $!\n");
- my $buf = '';
- sysread(F, $buf, 0, 4096);
- close F;
- return 1 unless $buf =~ /[\000-\037]/s;
+ return 1 if -T $file;
return 0;

I don't like that because it's locale dependant.

M.
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >