- g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, &err);
+ if(!expanded_argv_gchar) return 0;
+ for (int i=0; i<argc; i++)
+ {
+ expanded_argv[i] = g_string_new("");
+ for (int j=0; argv[i][j]; j++)
+ {
+ if (argv[i][j]=='%' && argv[i][j+1]=='%')
+ {
+ j++;
+ g_string_append_c(expanded_argv[i], '%');
+ }
+ else
+ if (argv[i][j]=='%' && argv[i][j+1]=='n')
+ {
+ j++;
+ const gchar * name = gtk_entry_get_text(GTK_ENTRY(namebox));
+ g_string_append(expanded_argv[i], name);
+ }
+ else
+ g_string_append_c(expanded_argv[i], argv[i][j]);
+ }
+ expanded_argv_gchar[i] = expanded_argv[i]->str;
+ }
+ expanded_argv_gchar[argc]=NULL;
+ g_spawn_async(NULL, expanded_argv_gchar, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, &err);