Re: [classad-users] strange behaviour


Date: Wed, 28 May 2003 13:35:15 -0500 (CDT)
From: Alain Roy <roy@xxxxxxxxxxx>
Subject: Re: [classad-users] strange behaviour
You're right--there is a bug. It is not your fault.

I have fixed this bug, and it will be in the next release of the ClassAd 
library, 0.9.5. (You are a few versions behind.)

If you want to fix it in 0.9.1, you can edit just a single line of code. 
Take a look at MakeClassAd in classad.C. In there is a for loop that looks 
like this:

for( itr = attrs.begin( ); itr != attrs.end( ); itr++ ) {
    if( !Insert( itr->first, itr->second ) ) {

Change it to read:

for( itr = attrs.begin( ); itr != attrs.end( ); itr++ ) {
    if( !newAd->Insert( itr->first, itr->second ) ) {

The only change is that I put "newAd->" before Insert. It's a silly error!

While I was at it, I declared this function static, so that you don't need 
to create a ClassAd to use it, but you can just call:

  ClassAd::MakeClassAd()

That is clearly the way it should be. This too will be in the next release.

Thanks for bringing this bug to our attention.

-alain


[← Prev in Thread] Current Thread [Next in Thread→]