Clearly the commits belong together, but somebody failed to squash them.
-const char cgi_rcs[] = "$Id: cgi.c,v 1.148 2012/03/09 16:23:50 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.149 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
/* Note: "example.com" and "example.com." are equivalent hostnames. */
/* Either the host matches CGI_SITE_1_HOST ..*/
- if ( ( (0 == strcmpic(host, CGI_SITE_1_HOST))
+ if ( ( (0 == strcmpic(host, CGI_SITE_1_HOST))
|| (0 == strcmpic(host, CGI_SITE_1_HOST ".")))
&& (path[0] == '/'))
{
path++;
}
/* Or it's the host part CGI_SITE_2_HOST, and the path CGI_SITE_2_PATH */
- else if (( (0 == strcmpic(host, CGI_SITE_2_HOST))
+ else if (( (0 == strcmpic(host, CGI_SITE_2_HOST))
|| (0 == strcmpic(host, CGI_SITE_2_HOST ".")))
&& (0 == strncmpic(path, CGI_SITE_2_PATH, strlen(CGI_SITE_2_PATH))))
{
/* Validate template name. Paranoia. */
for (p = templatename; *p != 0; p++)
{
- if (((*p < 'a') || (*p > 'z'))
+ if ( ((*p < 'a') || (*p > 'z'))
&& ((*p < 'A') || (*p > 'Z'))
&& ((*p < '0') || (*p > '9'))
&& (*p != '-')
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.73 2012/03/09 16:23:50 fabiankeil Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.74 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
cur_line = cur_line->next;
}
- if ((cur_line == NULL)
+ if ( (cur_line == NULL)
|| (line_number != patternid)
|| (patternid < 1U)
|| (cur_line->type != FILE_LINE_URL))
cur_line = cur_line->next;
}
- if ((cur_line == NULL)
+ if ( (cur_line == NULL)
|| (line_number != patternid)
|| (patternid < 1U)
|| (cur_line->type != FILE_LINE_URL))
* empty (which is valid, but pointless).
*/
while ((cur_line != NULL)
- && (cur_line->unprocessed[0] == '\0'))
+ && (cur_line->unprocessed[0] == '\0'))
{
/* Blank line */
cur_line->type = FILE_LINE_BLANK;
}
if ((cur_line != NULL)
- && (cur_line->unprocessed[0] != '{'))
+ && (cur_line->unprocessed[0] != '{'))
{
/* File doesn't start with a header */
file->parse_error = cur_line;
}
if ((cur_line != NULL) && (0 ==
- match_actions_file_header_line(cur_line->unprocessed, "settings")) )
+ match_actions_file_header_line(cur_line->unprocessed, "settings")))
{
cur_line->type = FILE_LINE_SETTINGS_HEADER;
}
if ((cur_line != NULL) && (0 ==
- match_actions_file_header_line(cur_line->unprocessed, "description")) )
+ match_actions_file_header_line(cur_line->unprocessed, "description")))
{
cur_line->type = FILE_LINE_DESCRIPTION_HEADER;
}
if ((cur_line != NULL) && (0 ==
- match_actions_file_header_line(cur_line->unprocessed, "alias")) )
+ match_actions_file_header_line(cur_line->unprocessed, "alias")))
{
cur_line->type = FILE_LINE_ALIAS_HEADER;
}
while ((len > (size_t)0)
&& ((text[len - 1] == ' ')
- || (text[len - 1] == '\t')) )
+ || (text[len - 1] == '\t')))
{
len--;
}
s = param;
while ((ch = *s++) != '\0')
{
- if (((ch < 'A') || (ch > 'Z'))
+ if ( ((ch < 'A') || (ch > 'Z'))
&& ((ch < 'a') || (ch > 'z'))
&& ((ch < '0') || (ch > '9'))
&& (ch != '-')
* cur_line->next = /
* cur_line->next->next = {...actions...} or EOF
*/
- if ((cur_line != NULL)
+ if ( (cur_line != NULL)
&& (cur_line->type == FILE_LINE_ACTION)
&& (cur_line->next != NULL)
&& (cur_line->next->type == FILE_LINE_URL)
&& (0 == strcmp(cur_line->next->unprocessed, "/"))
- && ((cur_line->next->next == NULL)
+ && ( (cur_line->next->next == NULL)
|| (cur_line->next->next->type != FILE_LINE_URL)
- ) )
+ ) )
{
/*
* Generate string with buttons to set actions for "/" to
if (!err) err = map(section_exports, "s-next", 1, buf, 1);
if ((cur_line != NULL)
- && (cur_line->type == FILE_LINE_ACTION))
+ && (cur_line->type == FILE_LINE_ACTION))
{
/* Not last section */
if (!err) err = map_block_keep(section_exports, "s-next-exists");
cur_line = cur_line->next;
}
- if ((cur_line == NULL)
+ if ( (cur_line == NULL)
|| (line_number != sectionid)
|| (sectionid < 1)
|| (cur_line->type != FILE_LINE_ACTION))
cur_line = cur_line->next;
}
- if ((cur_line == NULL)
+ if ( (cur_line == NULL)
|| (line_number != sectionid)
|| (sectionid < 1)
|| (cur_line->type != FILE_LINE_ACTION))
}
if ((cur_line == NULL)
- || (cur_line->type != FILE_LINE_URL))
+ || (cur_line->type != FILE_LINE_URL))
{
/* Invalid "patternid" parameter */
free(new_pattern);
}
if ((cur_line == NULL)
- || (cur_line->type != FILE_LINE_ACTION))
+ || (cur_line->type != FILE_LINE_ACTION))
{
/* Invalid "sectionid" parameter */
free(new_pattern);
line_number++;
}
- if ((cur_line == NULL)
+ if ( (cur_line == NULL)
|| (prev_line == NULL)
|| (cur_line->type != FILE_LINE_URL))
{
}
if ((cur_line == NULL)
- || (cur_line->type != FILE_LINE_ACTION))
+ || (cur_line->type != FILE_LINE_ACTION))
{
/* Invalid "sectionid" parameter */
edit_free_file(file);
}
if ((cur_line->next != NULL)
- && (cur_line->next->type == FILE_LINE_URL))
+ && (cur_line->next->type == FILE_LINE_URL))
{
/* Section not empty. */
edit_free_file(file);
}
if ((cur_line == NULL)
- || (cur_line->type != FILE_LINE_ACTION))
+ || (cur_line->type != FILE_LINE_ACTION))
{
/* Invalid "sectionid" parameter */
edit_free_file(file);
/* Skip through the section to find the last line in it. */
while ((cur_line->next != NULL)
- && (cur_line->next->type != FILE_LINE_ACTION))
+ && (cur_line->next->type != FILE_LINE_ACTION))
{
cur_line = cur_line->next;
line_number++;
}
if ((cur_line == NULL)
- || (cur_line->type != FILE_LINE_ACTION))
+ || (cur_line->type != FILE_LINE_ACTION))
{
/* Invalid "section1" parameter */
edit_free_file(file);
}
if ((cur_line == NULL)
- || (cur_line->type != FILE_LINE_ACTION))
+ || (cur_line->type != FILE_LINE_ACTION))
{
/* Invalid "section2" parameter */
edit_free_file(file);
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.113 2012/03/09 16:23:50 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.114 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
(global_toggle_state == 1) &&
#endif /* def FEATURE_TOGGLE */
map_block_killer(exports, "privoxy-is-toggled-off")
- )
+ )
{
free_map(exports);
return JB_ERR_MEMORY;
-const char encode_rcs[] = "$Id: encode.c,v 1.25 2012/03/09 16:23:50 fabiankeil Exp $";
+const char encode_rcs[] = "$Id: encode.c,v 1.26 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/encode.c,v $
{
char c;
char *p = buf;
- while((c = *s++) != '\0')
+ while ((c = *s++) != '\0')
{
const unsigned int i = (unsigned char)c;
if (i >= sizeof(allowed_characters) || '\0' == allowed_characters[i])
-const char errlog_rcs[] = "$Id: errlog.c,v 1.112 2011/09/04 11:10:56 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.113 2012/03/09 16:23:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
#ifndef _WIN32
|| (logfp == NULL)
#endif
- )
+ )
{
if (loglevel == LOG_LEVEL_FATAL)
{
if ((length >= log_buffer_size)
|| (outbuf[log_buffer_size-1] != '\0')
|| (outbuf[log_buffer_size] != '\0')
- )
+ )
{
/* Repeat as assertions */
assert(length < log_buffer_size);
-const char filters_rcs[] = "$Id: filters.c,v 1.168 2012/03/09 16:23:50 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.169 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
#else
(csp->ip_addr_long & acl->src->mask) == acl->src->addr
#endif
- )
+ )
{
if (dst == NULL)
{
((dst->addr & acl->dst->mask) == acl->dst->addr)
&& ((dst->port == acl->dst->port) || (acl->dst->port == 0))
#endif
- )
+ )
{
if (acl->action == ACL_PERMIT)
{
#else
(masklength > 32)
#endif
- )
+ )
{
freez(acl_spec);
return(-1);
}
if ((new_url != NULL)
- && ( (new_url != subject)
+ && ( (new_url != subject)
|| (0 == strncmpic(subject, "http://", 7))
|| (0 == strncmpic(subject, "https://", 8))
- ))
+ ))
{
/*
* Return new URL if we found a redirect
string_append(&new_entry, csp->http->hostport);
path = csp->http->path;
- if ((path[0] == '/')
+ if ( (path[0] == '/')
&& (path[1] == '~')
&& ((path_end = strchr(path + 2, '/')) != NULL))
{
size = (size_t)(csp->iob->eod - csp->iob->cur);
- if ( (NULL == (in = (struct binbuffer *)zalloc(sizeof *in)))
- || (NULL == (out = (struct binbuffer *)zalloc(sizeof *out))))
+ if ( (NULL == (in = (struct binbuffer *)zalloc(sizeof *in )))
+ || (NULL == (out = (struct binbuffer *)zalloc(sizeof *out))) )
{
log_error(LOG_LEVEL_DEANIMATE, "failed! (no mem)");
return NULL;
-const char gateway_rcs[] = "$Id: gateway.c,v 1.84 2012/02/29 19:35:11 fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.85 2012/03/09 16:23:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
return FALSE;
}
- if (( (NULL != connection->gateway_host)
+ if (( (NULL != connection->gateway_host)
&& (NULL != fwd->gateway_host)
&& strcmpic(connection->gateway_host, fwd->gateway_host))
&& (connection->gateway_host != fwd->gateway_host))
return FALSE;
}
- if (( (NULL != connection->forward_host)
+ if (( (NULL != connection->forward_host)
&& (NULL != fwd->forward_host)
&& strcmpic(connection->forward_host, fwd->forward_host))
&& (connection->forward_host != fwd->forward_host))
strncpy(cbuf + client_pos, target_host, sizeof(cbuf) - client_pos);
client_pos += (hostlen & 0xffu);
cbuf[client_pos++] = (char)((target_port >> 8) & 0xff);
- cbuf[client_pos++] = (char)((target_port ) & 0xff);
+ cbuf[client_pos++] = (char)((target_port ) & 0xff);
if (write_socket(sfd, cbuf, client_pos))
{
-const char list_rcs[] = "$Id: list.c,v 1.27 2012/03/04 11:41:32 fabiankeil Exp $";
+const char list_rcs[] = "$Id: list.c,v 1.28 2012/03/09 16:23:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/list.c,v $
assert(the_map);
- if ((NULL == value)
+ if ( (NULL == value)
|| (NULL == name)
|| (NULL == (new_entry = zalloc(sizeof(*new_entry)))))
{
-const char loaders_rcs[] = "$Id: loaders.c,v 1.88 2012/03/09 16:23:50 fabiankeil Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 1.89 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loaders.c,v $
while (fl != NULL)
{
- if (( 0 == fl->active) && ( NULL != fl->unloader ) )
+ if ((0 == fl->active) && (NULL != fl->unloader))
{
nfl->next = fl->next;
/* Main loop. Loop while we need more data & it's not EOF. */
while ((contflag || is_empty)
- && (JB_ERR_OK == (rval = simple_read_line(fp, &linebuf, newline))))
+ && (JB_ERR_OK == (rval = simple_read_line(fp, &linebuf, newline))))
{
if (line_number)
{
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.74 2012/03/09 16:23:50 fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.75 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
while (*s1 && *s2)
{
- if (( *s1 != *s2) && ( privoxy_tolower(*s1) != privoxy_tolower(*s2) ) )
+ if ((*s1 != *s2) && (privoxy_tolower(*s1) != privoxy_tolower(*s2)))
{
break;
}
while (*s1 && *s2)
{
- if (( *s1 != *s2) && ( privoxy_tolower(*s1) != privoxy_tolower(*s2) ) )
+ if ((*s1 != *s2) && (privoxy_tolower(*s1) != privoxy_tolower(*s2)))
{
break;
}
#else /* ifndef _WIN32 || __OS2__ */
|| (*file == '/') /* Absolute path (U*ix) */
#endif /* ifndef _WIN32 || __OS2__ */
- )
+ )
{
return strdup(file);
}
tmp[str_arg_l++] = space_for_positive ? ' ' : '+';
#endif
} else if (alternate_form) {
- if (arg_sign != 0 && (fmt_spec == 'x' || fmt_spec == 'X'))
+ if (arg_sign != 0 && (fmt_spec == 'x' || fmt_spec == 'X') )
{ tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = fmt_spec; }
/* alternate form should have no effect for p conversion, but ... */
#ifdef HPUX_COMPATIBLE
/* Actually it uses 0x prefix even for a zero value. */
&& arg_sign != 0
#endif
- ) { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = 'x'; }
+ ) { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = 'x'; }
#endif
}
zero_padding_insertion_ind = str_arg_l;
* converting a zero value with a precision of zero is a null string.
* Actually HP returns all zeroes, and Linux returns "(nil)". */
#endif
- ) {
+ ) {
/* converted to null string */
/* When zero value is formatted with an explicit precision 0,
the resulting formatted string is empty (d, i, u, o, x, X, p). */
if (zero_padding_insertion_ind+1 < str_arg_l &&
tmp[zero_padding_insertion_ind] == '0' &&
(tmp[zero_padding_insertion_ind+1] == 'x' ||
- tmp[zero_padding_insertion_ind+1] == 'X')) {
+ tmp[zero_padding_insertion_ind+1] == 'X') ) {
zero_padding_insertion_ind += 2;
}
}
&& !(zero_padding_insertion_ind < str_arg_l
&& tmp[zero_padding_insertion_ind] == '0')
#endif
- ) { /* assure leading zero for alternate-form octal numbers */
+ ) { /* assure leading zero for alternate-form octal numbers */
if (!precision_specified || precision < num_of_digits+1) {
/* precision is increased to force the first character to be zero,
except if a zero value is formatted with an explicit precision
-const char pcrs_rcs[] = "$Id: pcrs.c,v 1.38 2011/09/04 11:10:56 fabiankeil Exp $";
+const char pcrs_rcs[] = "$Id: pcrs.c,v 1.39 2012/03/09 16:23:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/pcrs.c,v $
result_offset,
subject + matches[i].submatch_offset[job->substitute->backref[k]],
matches[i].submatch_length[job->substitute->backref[k]]
- );
+ );
result_offset += matches[i].submatch_length[job->substitute->backref[k]];
}
}
-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.68 2012/03/09 16:23:50 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.69 2012/03/09 16:24:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
*/
if (*http->url == '*')
{
- if (NULL == (http->path = strdup("*"))
- || NULL == (http->hostport = strdup("")))
+ if (NULL == (http->path = strdup("*"))
+ || NULL == (http->hostport = strdup("")))
{
return JB_ERR_MEMORY;
}
freez(buf);
if ((http->path == NULL)
- || (http->hostport == NULL))
+ || (http->hostport == NULL))
{
return JB_ERR_MEMORY;
}
freez(buf);
- if ((http->cmd == NULL)
+ if ( (http->cmd == NULL)
|| (http->gpc == NULL)
|| (http->ver == NULL))
{
* Char match, or char range match?
*/
if ((*pat == *txt)
- || (*pat == '?')
- || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8)))))
+ || (*pat == '?')
+ || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8)))))
{
/*
* Success: Go ahead
}
/* Cut off extra '*'s */
- if (*pat == '*') pat++;
+ if (*pat == '*') pat++;
/* If this is the pattern's end, fine! */
return(*pat);
-const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $";
+const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.13 2012/03/09 16:23:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/w32taskbar.c,v $
GetCursorPos(&pt);
SetForegroundWindow(g_hwndLogFrame);
TrackPopupMenu(hmenu, TPM_LEFTALIGN | TPM_TOPALIGN, pt.x, pt.y, 0, g_hwndLogFrame, NULL);
- PostMessage(g_hwndLogFrame, WM_NULL, 0, 0) ;
+ PostMessage(g_hwndLogFrame, WM_NULL, 0, 0);
}
else if (uMouseMsg == WM_LBUTTONDBLCLK)
{