This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PING global maintainer/testsuite expert] Re: [patch bfd]: Win32 coff-i386 and coff-x86_64 broken in_reloc_p
On 31/03/2010 20:16, Kai Tietz wrote:
> 2010/3/31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
>> * Kai Tietz wrote on Wed, Mar 31, 2010 at 09:05:28PM CEST:
>>> 2010/3/31 Ralf Wildenhues:
>>>> wc -c is POSIX and portable, but you cannot be sure about the amount of
>>>> whitespace in the output: for example, IRIX, AIX, Tru64, FreeBSD,
>>>> OpenBSD wc produce varying amounts of leading whitespace, GNU doesn't.
>>>> Does tcl strip that? Otherwise, if all you're trying to find out is
>>>> whether a file is nonempty or not, testing the exit status of shell
>>>> 'test -s' works.
>>> There are no whitespaces. It is an binary file-format and no text.
>> I was talking about the output of
>> $ wc -c somefile
>>
>> which can be either of
>> 1204 somefile
>> 1204 somefile
>> 1204 somefile
>> 1204 somefile
>>
>> not the contents of "somefile". I haven't checked TABs vs. spaces.
>
> Ah, ok. Sorry, I got this wrong. I am not sure if 'string match' trims
> for white-spaces.
Probably not. How about:
> - if ![string match "0 tmpdir/$testname.base" $err] then {
> + if ![string match "0 tmpdir/$testname.base" [string trim $err]] then {
That ought to do it. It's certainly a safe precautionary change, so Kai,
it's pre-approved if you'd like to just test it and make sure it doesn't break.
cheers,
DaveK