Ticket #3870 (closed defect: fixed)

Opened 3 weeks ago

Last modified 3 weeks ago

fix INPUT_COMPLETE_CD in quick widget

Reported by: dzabraev Owned by: andrew_b
Priority: trivial Milestone: 4.8.20
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description (last modified by andrew_b) (diff)

Seems to be I found bug in quick widget (lib/widget/quick.c:593).
After dlg_run return, it does check of input values,
in this code there is line

case quick_input:

 if ((quick_widget->u.input.completion_flags & INPUT_COMPLETE_CD) != 0)

But quick_widget is iteration variable from previous cycle and this variable always initialized to QUICK_END.

I suggest following patch

diff --git a/lib/widget/quick.c b/lib/widget/quick.c
index 555d79c4c..3a3d014fb 100644
--- a/lib/widget/quick.c
+++ b/lib/widget/quick.c
@@ -590,7 +590,7 @@ quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip)
                 break;
 
             case quick_input:
-                if ((quick_widget->u.input.completion_flags & INPUT_COMPLETE_CD) != 0)
+                if ((*item->quick_widget->u.input.completion_flags & INPUT_COMPLETE_CD) != 0)
                     *item->quick_widget->u.input.result =
                         tilde_expand (INPUT (item->widget)->buffer);
                 else

Change History

comment:1 Changed 3 weeks ago by dzabraev

Ooops in ticket my patch isn't readable

diff --git a/lib/widget/quick.c b/lib/widget/quick.c
index 555d79c4c..3a3d014fb 100644
--- a/lib/widget/quick.c
+++ b/lib/widget/quick.c
@@ -590,7 +590,7 @@ quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip)
                 break;
 
             case quick_input:
-                if ((quick_widget->u.input.completion_flags & INPUT_COMPLETE_CD) != 0)
+                if ((item->quick_widget->u.input.completion_flags & INPUT_COMPLETE_CD) != 0)
                     *item->quick_widget->u.input.result =
                         tilde_expand (INPUT (item->widget)->buffer);
                 else
Last edited 3 weeks ago by dzabraev (previous) (diff)

comment:2 Changed 3 weeks ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Description modified (diff)
  • Milestone changed from Future Releases to 4.8.20

comment:3 Changed 3 weeks ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from no branch to approved

You're correct.
Thanks for the patch.

Branch: 3870_quick_complete_cd
changeset:16b569986eacfc4ade91f8624cb190863a736f28

comment:4 Changed 3 weeks ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:5 Changed 3 weeks ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.