
On Fri, 2004-01-23 at 11:09, bulia byak wrote:
Mental, could you please review my change to xml/repr-action.cpp in line 230, instead of
if (strcmp(action->act.chgattr.oldval, iter->act.chgattr.newval)) break;
I added extra checks
if (action->act.chgattr.oldval && iter->act.chgattr.newval && strcmp(action->act.chgattr.oldval, iter->act.chgattr.newval)) break;
I think that's nearly the right fix, though the intent is to break if the old and new values are different, which that won't quite do by itself.
Hrm. I wonder what the most succinct way of doing this is?
if ( action->act.chgattr.oldval && iter->act.chgattr.newval ) { if (strcmp(action->act.chgattr.oldval, iter->act.chgattr.newval)) { break; } } else { if ( action->act.chgattr.oldval != iter->act.chgattr.newval ) { break; } }
I think that's the best I can think of at the moment. The truth table is:
oldval NULL non-NULL +---------+---------------+ NULL | false | true | newval +---------+---------------+ non-NULL | true | strcmp() != 0 | +---------+---------------+
-mental