Ticket #3870 (accepted defect) — at Version 2

Opened 7 years ago

Last modified 7 years 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:

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 7 years 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 7 years ago by dzabraev (previous) (diff)

comment:2 Changed 7 years 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
Note: See TracTickets for help on using tickets.