[haiku] Re: Adding a bitmap as icon

  • From: Pete Goodeve <pete.goodeve@xxxxxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sun, 3 Jan 2016 18:04:43 -0800

On Sun, Jan 03, 2016 at 05:08:10PM -0800, Pete Goodeve wrote:

Further, if you look at the source (in main.cpp) there is code to
read a direct alpha representation of the type code, e.g. "ICON"
or "MICN".  However this just doesn't work!  Always throws an  error.

I did a little debugging, and noticed that the sscanf uses "'%c%c%c'".
Note the inner quotes!  Which of course never arrive, because they're
not on the argument and get stripped off by the shell if you add them!
(I found that ... -t "'ICON'" ... does work (:-/))

On reflection, I'm wondering if that bit of code was put in as a "secret
back door", so that the double-quote-wrap could be used to enter an
arbitrary typecode if one knew the scheme.  The problem with removing
the quotes is that then *any* 4-char string will be legal, so that mis-typed
names would never be flagged.

I suggest adding another option for direct typecodes would be good,
as it's too desirable a feature to have hidden. 

 I'll wait for some feedback before I start patching...

        -- Pete --

Other related posts: