Mailinglist Archive: opensuse-buildservice (351 mails)

< Previous Next >
Re: [opensuse-buildservice] osc submitreq accept broken
  • From: Dirk Mueller <dmueller@xxxxxxx>
  • Date: Mon, 14 Jul 2008 23:33:23 +0200
  • Message-id: <200807142333.23948.dmueller@xxxxxxx>
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;
}


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

< Previous Next >
Follow Ups