[barcode] Bugfix for Barcode_Encode

Alessandro Rubini rubini@gnu.org
Fri, 1 Mar 2002 23:36:26 +0100


> : Well found. I'm not sure about your fix, though. With your patch if I
> : only pass NOHEADERS I loose the encoding from bc->flags and will end
> : up with no selected encoding. Will see...
> 
> True... I hadn't thought of that.  In that case, perhaps a separate test
> (similar to the encoding test) for NOHEADERS is in order.

I've done like it already is in Barcode_Print(). Each bit (or bitset)
is either taken from the argument "flags" or from the data structure.
Obviously, this means you can't forcibly clear a flag, only set it;
it's still the most linear way (otherwise, we'd need to bits for each
flag: force-set and force-unset).

I think it should be right this time.

/alessandro, tired and willing to release immediately (after an icecream...)