diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-04-16 17:25:00 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-04-16 17:25:00 +0200 |
commit | 0f02b827409d7417b5055b20390546b5e89d6e92 (patch) | |
tree | e3f03698f33e58b767f5e728b2ec40883144d16d | |
parent | 51a9bc9cf99804624fe2e59df0ad5307241d4bc1 (diff) |
[Run] Restore completer input.
-rw-r--r-- | source/dialogs/run.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/dialogs/run.c b/source/dialogs/run.c index 2c81ca64..8fc7e80d 100644 --- a/source/dialogs/run.c +++ b/source/dialogs/run.c @@ -86,6 +86,7 @@ typedef struct char *old_input; Mode *completer; + char *old_completer_input; } RunModePrivateData; /** @@ -390,6 +391,7 @@ static void run_mode_destroy ( Mode *sw ) } g_free ( rmpd->cmd_list ); g_free ( rmpd->old_input ); + g_free ( rmpd->old_completer_input ); mode_destroy ( rmpd->completer ); g_free ( rmpd ); sw->private_data = NULL; @@ -419,7 +421,8 @@ static ModeMode run_mode_result ( Mode *sw, int mretv, char **input, unsigned in retv = RELOAD_DIALOG; if ( ( mretv& (MENU_COMPLETE)) ) { - if ( *input ) g_free (*input); + g_free ( rmpd->old_completer_input ); + rmpd->old_completer_input = *input; *input = NULL; if ( rmpd->selected_line < rmpd->cmd_list_length ) { (*input) = g_strdup ( rmpd->old_input ); @@ -479,7 +482,7 @@ static ModeMode run_mode_result ( Mode *sw, int mretv, char **input, unsigned in rmpd->old_input = g_strdup ( *input ); if ( *input ) g_free (*input); - *input = NULL; + *input = g_strdup ( rmpd->old_completer_input ); rmpd->file_complete = TRUE; } |