diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-04-15 19:06:39 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-04-15 19:06:39 +0200 |
commit | 0214d5a6e486611b8ac076386fc8ab74af0ef48b (patch) | |
tree | cbad32534d6ac54e9f29e7e6c5f87f594ee6794f | |
parent | 758714995091977ec0dd87b7c664cd3f36a7d093 (diff) |
[DRun] Adding %% as escape character.
-rw-r--r-- | source/dialogs/drun.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c index 0a0d7ff2..1f7871c2 100644 --- a/source/dialogs/drun.c +++ b/source/dialogs/drun.c @@ -181,6 +181,9 @@ static gboolean drun_helper_eval_cb ( const GMatchInfo *info, GString *res, gpoi case 'v': case 'm': break; + case '%': + g_string_append(res, "%"); + break; case 'k': if ( e->e->path ) { char *esc = g_shell_quote ( e->e->path ); @@ -209,7 +212,7 @@ static gboolean drun_helper_eval_cb ( const GMatchInfo *info, GString *res, gpoi static void exec_cmd_entry ( DRunModeEntry *e ) { GError *error = NULL; - GRegex *reg = g_regex_new ( "%[a-zA-Z]", 0, 0, &error ); + GRegex *reg = g_regex_new ( "%[a-zA-Z%]", 0, 0, &error ); if ( error != NULL ) { g_warning ( "Internal error, failed to create regex: %s.", error->message ); g_error_free ( error ); @@ -231,6 +234,7 @@ static void exec_cmd_entry ( DRunModeEntry *e ) g_warning ( "Nothing to execute after processing: %s.", e->exec );; return; } + g_debug ( "Parsed into command: %s into %s.", e->exec, str ); if ( e->key_file == NULL ) { GKeyFile *kf = g_key_file_new (); |