octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53209] inputdlg crashes if prompt and default


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #53209] inputdlg crashes if prompt and default cell arrays are different sizes
Date: Fri, 23 Feb 2018 04:31:34 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #3, bug #53209 (project octave):

I wrote the Qt inputdlg-related code so took a look at this.  Attached is a
fix; please test.

I also removed this comment that someone put in:


    // FIXME: Why define and then immediately test value?
#define LINE_EDIT_FOLLOWS_PROMPT 0

#if LINE_EDIT_FOLLOWS_PROMPT


It shouldn't be too much of a quandary why that was done.  First, I didn't
know what layout these input dialogs should have, so I put two versions in
there that someone who cares could pick the appropriate layout.  Second, John
suggested limiting definitions in files to not clutter the space.  So, this
definition is very limited in scope, as it is undefined about a dozen lines
later.  So the defines without the code are:


#define LINE_EDIT_FOLLOWS_PROMPT 0

#if LINE_EDIT_FOLLOWS_PROMPT
#else
#endif

#if LINE_EDIT_FOLLOWS_PROMPT
#else
#endif

#undef LINE_EDIT_FOLLOWS_PROMPT


Because the definition is used in two places, if we were to do the following:


#if 0
#else
#endif

#if 0
#else
#endif


both of the zeros would have to be changed to 1 to accomplish the equivalent
of changing LINE_EDIT_FOLLOWS_PROMPT to 1.  Third, the definition gives
meaning to what the pre-processor switch does.

If the definition isn't desired, let's pick the layout that has been used for
a while and discard the other code.

(file #43389)
    _______________________________________________________

Additional Item Attachment:

File name: octave-qt_inputdlg_crash_fix-djs2018feb23.patch Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53209>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]