From: Fabian Keil Date: Sat, 9 Feb 2008 15:15:38 +0000 (+0000) Subject: List active and inactive actions in the show-url-info's X-Git-Tag: v_3_0_9~243 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=0937125fc3744f897ffd81a26a89df662f75d1f1 List active and inactive actions in the show-url-info's "Final results" section separately. Patch submitted by Lee in #1830056, modified to list active actions first. --- diff --git a/ChangeLog b/ChangeLog index 94bbb427..5c89b084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ ChangeLog for Privoxy contain the pattern "/jump/". - The less-download-windows filter no longer messes "Content-Type: application/x-shockwave-flash" headers up. +- In the show-url-info page's "Final results" section active and + inactive actions are listed separately. Patch provided by Lee. *** Version 3.0.8 *** diff --git a/actions.c b/actions.c index fc612976..d530b4e8 100644 --- a/actions.c +++ b/actions.c @@ -1,4 +1,4 @@ -const char actions_rcs[] = "$Id: actions.c,v 1.40 2007/05/21 10:26:50 fabiankeil Exp $"; +const char actions_rcs[] = "$Id: actions.c,v 1.41 2008/01/28 20:17:40 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.c,v $ @@ -33,6 +33,10 @@ const char actions_rcs[] = "$Id: actions.c,v 1.40 2007/05/21 10:26:50 fabiankeil * * Revisions : * $Log: actions.c,v $ + * Revision 1.41 2008/01/28 20:17:40 fabiankeil + * - Mark some parameters as immutable. + * - Hide update_action_bits_for_all_tags() while it's unused. + * * Revision 1.40 2007/05/21 10:26:50 fabiankeil * - Use strlcpy() instead of strcpy(). * - Provide a reason why loading the actions @@ -1799,52 +1803,54 @@ char *current_action_to_html(const struct client_state *csp, const struct current_action_spec *action) { unsigned long flags = action->flags; - char * result = strdup(""); struct list_entry * lst; + char *result = strdup(""); + char *active = strdup(""); + char *inactive = strdup(""); #define DEFINE_ACTION_BOOL(__name, __bit) \ if (flags & __bit) \ { \ - string_append(&result, "\n
+"); \ - string_join(&result, add_help_link(__name, csp->config)); \ + string_append(&active, "\n
+"); \ + string_join(&active, add_help_link(__name, csp->config)); \ } \ else \ { \ - string_append(&result, "\n
-"); \ - string_join(&result, add_help_link(__name, csp->config)); \ + string_append(&inactive, "\n
-"); \ + string_join(&inactive, add_help_link(__name, csp->config)); \ } #define DEFINE_ACTION_STRING(__name, __bit, __index) \ if (flags & __bit) \ { \ - string_append(&result, "\n
+"); \ - string_join(&result, add_help_link(__name, csp->config)); \ - string_append(&result, "{"); \ - string_join(&result, html_encode(action->string[__index])); \ - string_append(&result, "}"); \ + string_append(&active, "\n
+"); \ + string_join(&active, add_help_link(__name, csp->config)); \ + string_append(&active, "{"); \ + string_join(&active, html_encode(action->string[__index])); \ + string_append(&active, "}"); \ } \ else \ { \ - string_append(&result, "\n
-"); \ - string_join(&result, add_help_link(__name, csp->config)); \ + string_append(&inactive, "\n
-"); \ + string_join(&inactive, add_help_link(__name, csp->config)); \ } #define DEFINE_ACTION_MULTI(__name, __index) \ lst = action->multi[__index]->first; \ if (lst == NULL) \ { \ - string_append(&result, "\n
-"); \ - string_join(&result, add_help_link(__name, csp->config)); \ + string_append(&inactive, "\n
-"); \ + string_join(&inactive, add_help_link(__name, csp->config)); \ } \ else \ { \ while (lst) \ { \ - string_append(&result, "\n
+"); \ - string_join(&result, add_help_link(__name, csp->config)); \ - string_append(&result, "{"); \ - string_join(&result, html_encode(lst->str)); \ - string_append(&result, "}"); \ + string_append(&active, "\n
+"); \ + string_join(&active, add_help_link(__name, csp->config)); \ + string_append(&active, "{"); \ + string_join(&active, html_encode(lst->str)); \ + string_append(&active, "}"); \ lst = lst->next; \ } \ } @@ -1858,5 +1864,16 @@ char *current_action_to_html(const struct client_state *csp, #undef DEFINE_ACTION_BOOL #undef DEFINE_ACTION_ALIAS + if (active != NULL) + { + string_append(&result, active); + freez(active); + } + string_append(&result, "\n
"); + if (inactive != NULL) + { + string_append(&result, inactive); + freez(inactive); + } return result; }