On 14-May-2002 Mr.X wrote:
> I'm using Blackbox version 0.65alpha3, and the [nop]
> menu item seems to have stopped working. It still puts
> up a non-operational menu selection, but it'll no
> longer let me give it a label. Maybe I'm doing it
> wrong, but I'm just using the same menu as before. I
> use it like this:
> 
> [nop] (--------)
> 
> That's for a separator. But the output I get looks
> like I just called [nop] with no (---------). For now
> I just replaced it with a bum [exec].

This is my fault.  I broke the code involved when I moved blackbox from char[]
to std::string.  Just committed a fix in cvs.

My problem was the old code did this:

case nop:
  menu->insert(label);

but label may have been all zeros unless one was defined.  So [nop] () would
crash blackbox because std::string expects a null terminated string.  To fix
this I changed it to:

menu->insert("");

which made the assumption all no ops were merely spacers.  So this time i fixed
the real problem which was invalid strings:

if (! *label)
  label[0] = '\0';
menu->insert(label);

Thanks for mentioning this.

P.S. an alpha4 should be out by weeks end.  Lots of new pretty code.

Reply via email to