From: Fabian Keil Date: Fri, 9 Mar 2012 16:23:50 +0000 (+0000) Subject: Fix white-space around parentheses X-Git-Tag: v_3_0_20~394 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=292da21cea2a42b0896d667cff7201ef0ea2894e Fix white-space around parentheses --- diff --git a/actions.c b/actions.c index 82495714..856c4d79 100644 --- a/actions.c +++ b/actions.c @@ -1,4 +1,4 @@ -const char actions_rcs[] = "$Id: actions.c,v 1.77 2012/02/29 19:31:12 fabiankeil Exp $"; +const char actions_rcs[] = "$Id: actions.c,v 1.78 2012/02/29 19:33:07 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.c,v $ @@ -501,7 +501,7 @@ jb_err get_actions(char *line, /* Check for standard action name */ const struct action_name * action = action_names; - while ( (action->name != NULL) && (0 != strcmpic(action->name, option)) ) + while ((action->name != NULL) && (0 != strcmpic(action->name, option))) { action++; } @@ -582,8 +582,8 @@ jb_err get_actions(char *line, struct list * remove_p = cur_action->multi_remove[action->index]; struct list * add_p = cur_action->multi_add[action->index]; - if ( (value == NULL) || (*value == '\0') - || ((*value == '*') && (value[1] == '\0')) ) + if ((value == NULL) || (*value == '\0') + || ((*value == '*') && (value[1] == '\0'))) { /* * no option, or option == "*". @@ -598,7 +598,7 @@ jb_err get_actions(char *line, { /* Valid option - remove only 1 option */ - if ( !cur_action->multi_remove_all[action->index] ) + if (!cur_action->multi_remove_all[action->index]) { /* there isn't a catch-all in the remove list already */ err = enlist_unique(remove_p, value, 0); @@ -622,7 +622,7 @@ jb_err get_actions(char *line, /* try user aliases. */ const struct action_alias * alias = alias_list; - while ( (alias != NULL) && (0 != strcmpic(alias->name, option)) ) + while ((alias != NULL) && (0 != strcmpic(alias->name, option))) { alias = alias->next; } @@ -1408,14 +1408,14 @@ static int load_one_actions_file(struct client_state *csp, int fileid) "While loading actions file '%s': invalid line (%lu): %s", csp->config->actions_file[fileid], linenum, buf); } - else if ( atoi(fields[0]) > VERSION_MAJOR + else if ( atoi(fields[0]) > VERSION_MAJOR || (num_fields > 1 && atoi(fields[1]) > VERSION_MINOR) || (num_fields > 2 && atoi(fields[2]) > VERSION_POINT)) { fclose(fp); log_error(LOG_LEVEL_FATAL, "Actions file '%s', line %lu requires newer Privoxy version: %s", - csp->config->actions_file[fileid], linenum, buf ); + csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } free(version_string); diff --git a/amiga.c b/amiga.c index 08696da3..c04ab8dd 100644 --- a/amiga.c +++ b/amiga.c @@ -1,4 +1,4 @@ -const char amiga_rcs[] = "$Id: amiga.c,v 1.13 2009/05/16 13:27:20 fabiankeil Exp $"; +const char amiga_rcs[] = "$Id: amiga.c,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/amiga.c,v $ @@ -268,7 +268,7 @@ void __memCleanUp (void) } } -#define ADD2LIST(a,b,c) asm(".stabs \"_" #b "\"," #c ",0,0,_" #a ) +#define ADD2LIST(a,b,c) asm(".stabs \"_" #b "\"," #c ",0,0,_" #a) #define ADD2EXIT(a,pri) ADD2LIST(a,__EXIT_LIST__,22); \ asm(".stabs \"___EXIT_LIST__\",20,0,0," #pri "+128") ADD2EXIT(__memCleanUp,-50); diff --git a/cgi.c b/cgi.c index d28b9204..62de9428 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.146 2011/12/31 14:47:44 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.147 2011/12/31 14:54:28 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -312,17 +312,17 @@ struct http_response *dispatch_cgi(struct client_state *csp) /* 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[0] == '/')) { /* ..then the path will all be for us. Remove leading '/' */ 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 )) - || (0 == strcmpic(host, CGI_SITE_2_HOST ".")) ) - && (0 == strncmpic(path, CGI_SITE_2_PATH, strlen(CGI_SITE_2_PATH))) ) + 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)))) { /* take everything following CGI_SITE_2_PATH */ path += strlen(CGI_SITE_2_PATH); @@ -723,8 +723,8 @@ jb_err get_string_param(const struct map *parameters, s = param; while ((ch = *s++) != '\0') { - if ( ((unsigned char)ch < (unsigned char)' ') - || (ch == '}') ) + if (((unsigned char)ch < (unsigned char)' ') + || (ch == '}')) { /* Probable hack attempt, or user accidentally used '}'. */ return JB_ERR_CGI_PARAMS; @@ -1808,7 +1808,7 @@ jb_err template_load(const struct client_state *csp, char **template_ptr, /* 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 != '-') diff --git a/cgiedit.c b/cgiedit.c index aec3be0f..728958a1 100644 --- a/cgiedit.c +++ b/cgiedit.c @@ -1,4 +1,4 @@ -const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.71 2011/11/18 16:47:08 fabiankeil Exp $"; +const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.72 2011/12/31 14:47:44 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $ @@ -494,7 +494,7 @@ jb_err cgi_edit_actions_url_form(struct client_state *csp, cur_line = cur_line->next; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (line_number != patternid) || (patternid < 1U) || (cur_line->type != FILE_LINE_URL)) @@ -654,7 +654,7 @@ jb_err cgi_edit_actions_remove_url_form(struct client_state *csp, cur_line = cur_line->next; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (line_number != patternid) || (patternid < 1U) || (cur_line->type != FILE_LINE_URL)) @@ -978,7 +978,7 @@ static int match_actions_file_header_line(const char * line, const char * name) line += 2; /* Look for optional whitespace */ - while ( (*line == ' ') || (*line == '\t') ) + while ((*line == ' ') || (*line == '\t')) { line++; } @@ -992,7 +992,7 @@ static int match_actions_file_header_line(const char * line, const char * name) line += len; /* Look for optional whitespace */ - while ( (*line == ' ') || (*line == '\t') ) + while ((*line == ' ') || (*line == '\t')) { line++; } @@ -1134,16 +1134,16 @@ jb_err edit_parse_actions_file(struct editable_file * file) /* Skip leading blanks. Should only happen if file is * empty (which is valid, but pointless). */ - while ( (cur_line != NULL) - && (cur_line->unprocessed[0] == '\0') ) + while ((cur_line != NULL) + && (cur_line->unprocessed[0] == '\0')) { /* Blank line */ cur_line->type = FILE_LINE_BLANK; cur_line = cur_line->next; } - if ( (cur_line != NULL) - && (cur_line->unprocessed[0] != '{') ) + if ((cur_line != NULL) + && (cur_line->unprocessed[0] != '{')) { /* File doesn't start with a header */ file->parse_error = cur_line; @@ -1151,8 +1151,8 @@ jb_err edit_parse_actions_file(struct editable_file * file) return JB_ERR_PARSE; } - if ( (cur_line != NULL) && (0 == - match_actions_file_header_line(cur_line->unprocessed, "settings") ) ) + if ((cur_line != NULL) && (0 == + match_actions_file_header_line(cur_line->unprocessed, "settings")) ) { cur_line->type = FILE_LINE_SETTINGS_HEADER; @@ -1186,8 +1186,8 @@ jb_err edit_parse_actions_file(struct editable_file * file) } } - if ( (cur_line != NULL) && (0 == - match_actions_file_header_line(cur_line->unprocessed, "description") ) ) + if ((cur_line != NULL) && (0 == + match_actions_file_header_line(cur_line->unprocessed, "description")) ) { cur_line->type = FILE_LINE_DESCRIPTION_HEADER; @@ -1206,8 +1206,8 @@ jb_err edit_parse_actions_file(struct editable_file * file) } } - if ( (cur_line != NULL) && (0 == - match_actions_file_header_line(cur_line->unprocessed, "alias") ) ) + if ((cur_line != NULL) && (0 == + match_actions_file_header_line(cur_line->unprocessed, "alias")) ) { cur_line->type = FILE_LINE_ALIAS_HEADER; @@ -1311,14 +1311,14 @@ jb_err edit_parse_actions_file(struct editable_file * file) return JB_ERR_PARSE; } - while ( (*text == ' ') || (*text == '\t') ) + while ((*text == ' ') || (*text == '\t')) { text++; len--; } - while ( (len > (size_t)0) - && ( (text[len - 1] == ' ') - || (text[len - 1] == '\t') ) ) + while ((len > (size_t)0) + && ((text[len - 1] == ' ') + || (text[len - 1] == '\t')) ) { len--; } @@ -1779,11 +1779,11 @@ static jb_err get_file_name_param(struct client_state *csp, 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 != '-') - && (ch != '_') ) + && (ch != '_')) { /* Probable hack attempt. */ return JB_ERR_CGI_PARAMS; @@ -2331,14 +2331,14 @@ jb_err cgi_edit_actions_list(struct client_state *csp, * 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 @@ -2530,7 +2530,7 @@ jb_err cgi_edit_actions_list(struct client_state *csp, if (!err) err = map(section_exports, "actions", 1, actions_to_html(csp, cur_line->data.action), 0); - if ( (!err) + if ((!err) && (cur_line->next != NULL) && (cur_line->next->type == FILE_LINE_URL)) { @@ -2668,7 +2668,7 @@ jb_err cgi_edit_actions_list(struct client_state *csp, snprintf(buf, sizeof(buf), "%d", line_number); if (!err) err = map(section_exports, "s-next", 1, buf, 1); - if ( (cur_line != NULL) + if ((cur_line != NULL) && (cur_line->type == FILE_LINE_ACTION)) { /* Not last section */ @@ -2793,7 +2793,7 @@ jb_err cgi_edit_actions_for_url(struct client_state *csp, cur_line = cur_line->next; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (line_number != sectionid) || (sectionid < 1) || (cur_line->type != FILE_LINE_ACTION)) @@ -3072,7 +3072,7 @@ jb_err cgi_edit_actions_submit(struct client_state *csp, cur_line = cur_line->next; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (line_number != sectionid) || (sectionid < 1) || (cur_line->type != FILE_LINE_ACTION)) @@ -3363,7 +3363,7 @@ jb_err cgi_edit_actions_url(struct client_state *csp, line_number++; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (cur_line->type != FILE_LINE_URL)) { /* Invalid "patternid" parameter */ @@ -3475,7 +3475,7 @@ jb_err cgi_edit_actions_add_url(struct client_state *csp, line_number++; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (cur_line->type != FILE_LINE_ACTION)) { /* Invalid "sectionid" parameter */ @@ -3598,7 +3598,7 @@ jb_err cgi_edit_actions_remove_url(struct client_state *csp, line_number++; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (prev_line == NULL) || (cur_line->type != FILE_LINE_URL)) { @@ -3705,16 +3705,16 @@ jb_err cgi_edit_actions_section_remove(struct client_state *csp, line_number++; } - if ( (cur_line == NULL) - || (cur_line->type != FILE_LINE_ACTION) ) + if ((cur_line == NULL) + || (cur_line->type != FILE_LINE_ACTION)) { /* Invalid "sectionid" parameter */ edit_free_file(file); return JB_ERR_CGI_PARAMS; } - if ( (cur_line->next != NULL) - && (cur_line->next->type == FILE_LINE_URL) ) + if ((cur_line->next != NULL) + && (cur_line->next->type == FILE_LINE_URL)) { /* Section not empty. */ edit_free_file(file); @@ -3828,8 +3828,8 @@ jb_err cgi_edit_actions_section_add(struct client_state *csp, /* There's something in the file, find the line before the first * action. */ - while ( (cur_line->next != NULL) - && (cur_line->next->type != FILE_LINE_ACTION) ) + while ((cur_line->next != NULL) + && (cur_line->next->type != FILE_LINE_ACTION)) { cur_line = cur_line->next; line_number++; @@ -3850,7 +3850,7 @@ jb_err cgi_edit_actions_section_add(struct client_state *csp, line_number++; } - if ( (cur_line == NULL) + if ((cur_line == NULL) || (cur_line->type != FILE_LINE_ACTION)) { /* Invalid "sectionid" parameter */ @@ -3859,8 +3859,8 @@ jb_err cgi_edit_actions_section_add(struct client_state *csp, } /* Skip through the section to find the last line in it. */ - while ( (cur_line->next != NULL) - && (cur_line->next->type != FILE_LINE_ACTION) ) + while ((cur_line->next != NULL) + && (cur_line->next->type != FILE_LINE_ACTION)) { cur_line = cur_line->next; line_number++; @@ -4018,8 +4018,8 @@ jb_err cgi_edit_actions_section_swap(struct client_state *csp, line_number++; } - if ( (cur_line == NULL) - || (cur_line->type != FILE_LINE_ACTION) ) + if ((cur_line == NULL) + || (cur_line->type != FILE_LINE_ACTION)) { /* Invalid "section1" parameter */ edit_free_file(file); @@ -4050,8 +4050,8 @@ jb_err cgi_edit_actions_section_swap(struct client_state *csp, line_number++; } - if ( (cur_line == NULL) - || (cur_line->type != FILE_LINE_ACTION) ) + if ((cur_line == NULL) + || (cur_line->type != FILE_LINE_ACTION)) { /* Invalid "section2" parameter */ edit_free_file(file); diff --git a/cgisimple.c b/cgisimple.c index 54fa2167..198c8e77 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.111 2011/09/04 11:10:56 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.112 2011/12/31 14:47:44 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -1183,7 +1183,7 @@ jb_err cgi_show_url_info(struct client_state *csp, (global_toggle_state == 1) && #endif /* def FEATURE_TOGGLE */ map_block_killer(exports, "privoxy-is-toggled-off") - ) + ) { free_map(exports); return JB_ERR_MEMORY; @@ -1855,8 +1855,8 @@ static jb_err cgi_show_file(struct client_state *csp, return JB_ERR_MEMORY; } - if ( map(exports, "file-description", 1, file_description, 1) - || map(exports, "filepath", 1, html_encode(filename), 0) ) + if (map(exports, "file-description", 1, file_description, 1) + || map(exports, "filepath", 1, html_encode(filename), 0)) { free_map(exports); return JB_ERR_MEMORY; diff --git a/encode.c b/encode.c index 954e4529..cc9c1a00 100644 --- a/encode.c +++ b/encode.c @@ -1,4 +1,4 @@ -const char encode_rcs[] = "$Id: encode.c,v 1.23 2011/11/06 11:44:56 fabiankeil Exp $"; +const char encode_rcs[] = "$Id: encode.c,v 1.24 2011/11/06 11:51:57 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/encode.c,v $ @@ -142,7 +142,7 @@ char * html_encode(const char *s) { char c; char * p = buf; - while ( (c = *s++) != '\0') + while ((c = *s++) != '\0') { const char * replace_with = html_code_map[(unsigned char) c]; if(replace_with != NULL) @@ -236,7 +236,7 @@ char * url_encode(const char *s) { char c; char * p = buf; - while( (c = *s++) != '\0') + while((c = *s++) != '\0') { const char *replace_with = url_code_map[(unsigned char) c]; if (*replace_with != '\0') diff --git a/errlog.c b/errlog.c index 56587352..1cd39a33 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.111 2011/06/25 12:39:18 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.112 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -666,7 +666,7 @@ void log_error(int loglevel, const char *fmt, ...) #ifndef _WIN32 || (logfp == NULL) #endif - ) + ) { if (loglevel == LOG_LEVEL_FATAL) { @@ -743,11 +743,11 @@ void log_error(int loglevel, const char *fmt, ...) tempbuf[1] = '\0'; break; case 'd': - ival = va_arg( ap, int ); + ival = va_arg(ap, int); snprintf(tempbuf, sizeof(tempbuf), "%d", ival); break; case 'u': - uval = va_arg( ap, unsigned ); + uval = va_arg(ap, unsigned); snprintf(tempbuf, sizeof(tempbuf), "%u", uval); break; case 'l': @@ -755,12 +755,12 @@ void log_error(int loglevel, const char *fmt, ...) ch = *src++; if (ch == 'd') { - lval = va_arg( ap, long ); + lval = va_arg(ap, long); snprintf(tempbuf, sizeof(tempbuf), "%ld", lval); } else if (ch == 'u') { - ulval = va_arg( ap, unsigned long ); + ulval = va_arg(ap, unsigned long); snprintf(tempbuf, sizeof(tempbuf), "%lu", ulval); } else if ((ch == 'l') && (*src == 'u')) @@ -887,7 +887,7 @@ void log_error(int loglevel, const char *fmt, ...) if ((length >= log_buffer_size) || (outbuf[log_buffer_size-1] != '\0') || (outbuf[log_buffer_size] != '\0') - ) + ) { /* Repeat as assertions */ assert(length < log_buffer_size); diff --git a/filters.c b/filters.c index d48b7e07..3c3ae38e 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.166 2012/03/04 11:50:32 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.167 2012/03/04 11:51:25 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -261,7 +261,7 @@ int block_acl(const struct access_control_addr *dst, const struct client_state * #else (csp->ip_addr_long & acl->src->mask) == acl->src->addr #endif - ) + ) { if (dst == NULL) { @@ -291,7 +291,7 @@ int block_acl(const struct access_control_addr *dst, const struct client_state * ((dst->addr & acl->dst->mask) == acl->dst->addr) && ((dst->port == acl->dst->port) || (acl->dst->port == 0)) #endif - ) + ) { if (acl->action == ACL_PERMIT) { @@ -374,7 +374,7 @@ int acl_addr(const char *aspec, struct access_control_addr *aca) #else (masklength > 32) #endif - ) + ) { freez(acl_spec); return(-1); @@ -1174,10 +1174,10 @@ char *get_last_url(char *subject, const char *redirect_mode) } 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 @@ -1472,7 +1472,7 @@ int is_untrusted_url(const struct client_state *csp) 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)) { @@ -1719,8 +1719,8 @@ static char *gif_deanimate_response(struct client_state *csp) 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; diff --git a/gateway.c b/gateway.c index 2e43cb83..abc72725 100644 --- a/gateway.c +++ b/gateway.c @@ -1,4 +1,4 @@ -const char gateway_rcs[] = "$Id: gateway.c,v 1.83 2011/12/24 15:28:45 fabiankeil Exp $"; +const char gateway_rcs[] = "$Id: gateway.c,v 1.84 2012/02/29 19:35:11 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.c,v $ @@ -377,7 +377,7 @@ int connection_destination_matches(const struct reusable_connection *connection, 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)) @@ -388,7 +388,7 @@ int connection_destination_matches(const struct reusable_connection *connection, 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)) @@ -793,12 +793,12 @@ static jb_socket socks4_connect(const struct forward_spec * fwd, c->vn = 4; c->cd = 1; - c->dstport[0] = (unsigned char)((target_port >> 8 ) & 0xff); - c->dstport[1] = (unsigned char)((target_port ) & 0xff); - c->dstip[0] = (unsigned char)((web_server_addr >> 24 ) & 0xff); - c->dstip[1] = (unsigned char)((web_server_addr >> 16 ) & 0xff); - c->dstip[2] = (unsigned char)((web_server_addr >> 8 ) & 0xff); - c->dstip[3] = (unsigned char)((web_server_addr ) & 0xff); + c->dstport[0] = (unsigned char)((target_port >> 8 ) & 0xff); + c->dstport[1] = (unsigned char)((target_port ) & 0xff); + c->dstip[0] = (unsigned char)((web_server_addr >> 24) & 0xff); + c->dstip[1] = (unsigned char)((web_server_addr >> 16) & 0xff); + c->dstip[2] = (unsigned char)((web_server_addr >> 8) & 0xff); + c->dstip[3] = (unsigned char)((web_server_addr ) & 0xff); /* pass the request to the socks server */ sfd = connect_to(fwd->gateway_host, fwd->gateway_port, csp); @@ -1077,7 +1077,7 @@ static jb_socket socks5_connect(const struct forward_spec *fwd, 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)) { diff --git a/jbsockets.c b/jbsockets.c index 76eddf47..983f0c16 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.111 2011/12/10 17:26:30 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.112 2011/12/31 14:43:20 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -1346,7 +1346,7 @@ unsigned long resolve_hostname_to_ip(const char *host) (char *) &inaddr.sin_addr, (char *) hostp->h_addr, sizeof(inaddr.sin_addr) - ); + ); } return(inaddr.sin_addr.s_addr); diff --git a/jcc.c b/jcc.c index 5ae051c6..6661b34e 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.374 2011/11/06 11:58:51 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.375 2011/12/10 17:26:11 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -823,7 +823,7 @@ static void build_request_line(struct client_state *csp, const struct forward_sp * Downgrade http version from 1.1 to 1.0 * if +downgrade action applies. */ - if ( (csp->action->flags & ACTION_DOWNGRADE) + if ((csp->action->flags & ACTION_DOWNGRADE) && (!strcmpic(http->ver, "HTTP/1.1"))) { freez(http->ver); @@ -2922,7 +2922,7 @@ int main(int argc, char **argv) const char *pName = argv[argc_pos] + 9; if (*pName == ':') pName++; - exit( (install_service(pName)) ? 0 : 1 ); + exit((install_service(pName)) ? 0 : 1); } else if (strncmp(argv[argc_pos], "--uninstall", 11) == 0) { @@ -2931,7 +2931,7 @@ int main(int argc, char **argv) pName++; exit((uninstall_service(pName)) ? 0 : 1); } - else if (strcmp(argv[argc_pos], "--service" ) == 0) + else if (strcmp(argv[argc_pos], "--service") == 0) { bRunAsService = TRUE; w32_set_service_cwd(); @@ -2956,19 +2956,19 @@ int main(int argc, char **argv) #if defined(unix) - else if (strcmp(argv[argc_pos], "--no-daemon" ) == 0) + else if (strcmp(argv[argc_pos], "--no-daemon") == 0) { set_debug_level(LOG_LEVEL_FATAL | LOG_LEVEL_ERROR | LOG_LEVEL_INFO); daemon_mode = 0; } - else if (strcmp(argv[argc_pos], "--pidfile" ) == 0) + else if (strcmp(argv[argc_pos], "--pidfile") == 0) { if (++argc_pos == argc) usage(argv[0]); pidfile = strdup(argv[argc_pos]); } - else if (strcmp(argv[argc_pos], "--user" ) == 0) + else if (strcmp(argv[argc_pos], "--user") == 0) { char *user_arg; char *group_name; @@ -3005,13 +3005,13 @@ int main(int argc, char **argv) freez(user_arg); } - else if (strcmp(argv[argc_pos], "--pre-chroot-nslookup" ) == 0) + else if (strcmp(argv[argc_pos], "--pre-chroot-nslookup") == 0) { if (++argc_pos == argc) usage(argv[0]); pre_chroot_nslookup_to_load_resolver = strdup(argv[argc_pos]); } - else if (strcmp(argv[argc_pos], "--chroot" ) == 0) + else if (strcmp(argv[argc_pos], "--chroot") == 0) { do_chroot = 1; } @@ -3038,7 +3038,7 @@ int main(int argc, char **argv) show_version(Argv[0]); #if defined(unix) - if ( *configfile != '/' ) + if (*configfile != '/') { char cwd[BUFFER_SIZE]; char *abs_file; @@ -3048,7 +3048,7 @@ int main(int argc, char **argv) if (NULL == getcwd(cwd, sizeof(cwd))) { perror("failed to get current working directory"); - exit( 1 ); + exit(1); } /* XXX: why + 5? */ @@ -3059,10 +3059,10 @@ int main(int argc, char **argv) NULL == (abs_file = malloc(abs_file_size))) { perror("malloc failed"); - exit( 1 ); + exit(1); } strlcpy(abs_file, basedir, abs_file_size); - strlcat(abs_file, "/", abs_file_size ); + strlcat(abs_file, "/", abs_file_size); strlcat(abs_file, configfile, abs_file_size); configfile = abs_file; } @@ -3142,12 +3142,12 @@ int main(int argc, char **argv) int fd; pid_t pid = fork(); - if ( pid < 0 ) /* error */ + if (pid < 0) /* error */ { perror("fork"); - exit( 3 ); + exit(3); } - else if ( pid != 0 ) /* parent */ + else if (pid != 0) /* parent */ { int status; pid_t wpid; @@ -3155,13 +3155,13 @@ int main(int argc, char **argv) * must check for errors * child died due to missing files aso */ - sleep( 1 ); - wpid = waitpid( pid, &status, WNOHANG ); - if ( wpid != 0 ) + sleep(1); + wpid = waitpid(pid, &status, WNOHANG); + if (wpid != 0) { - exit( 1 ); + exit(1); } - exit( 0 ); + exit(0); } /* child */ @@ -3754,7 +3754,7 @@ static void listen_loop(void) int child_status; #if !defined(_WIN32) && !defined(__CYGWIN__) - wait( &child_status ); + wait(&child_status); /* * Evaluate child's return code: If the child has diff --git a/list.c b/list.c index 06256d58..d779d4e5 100644 --- a/list.c +++ b/list.c @@ -1,4 +1,4 @@ -const char list_rcs[] = "$Id: list.c,v 1.26 2011/12/31 14:47:44 fabiankeil Exp $"; +const char list_rcs[] = "$Id: list.c,v 1.27 2012/03/04 11:41:32 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/list.c,v $ @@ -351,7 +351,7 @@ jb_err enlist_unique(struct list *the_list, const char *str, { for (cur_entry = the_list->first; cur_entry != NULL; cur_entry = cur_entry->next) { - if ( (cur_entry->str != NULL) + if ((cur_entry->str != NULL) && (0 == strncmp(str, cur_entry->str, num_significant_chars))) { /* Already there */ @@ -364,7 +364,7 @@ jb_err enlist_unique(struct list *the_list, const char *str, /* Test whole string */ for (cur_entry = the_list->first; cur_entry != NULL; cur_entry = cur_entry->next) { - if ( (cur_entry->str != NULL) && (0 == strcmp(str, cur_entry->str))) + if ((cur_entry->str != NULL) && (0 == strcmp(str, cur_entry->str))) { /* Already there */ return JB_ERR_OK; @@ -977,9 +977,9 @@ jb_err map(struct map *the_map, assert(the_map); - if ( (NULL == value) + if ((NULL == value) || (NULL == name) - || (NULL == (new_entry = zalloc(sizeof(*new_entry)))) ) + || (NULL == (new_entry = zalloc(sizeof(*new_entry))))) { if ((name != NULL) && (!name_needs_copying)) { diff --git a/loadcfg.c b/loadcfg.c index 1fe24373..5de202cf 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.123 2012/03/04 11:49:24 fabiankeil Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.124 2012/03/04 11:51:25 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -544,7 +544,7 @@ struct configuration_spec * load_config(void) * *************************************************************************/ case hash_confdir : freez(config->confdir); - config->confdir = make_path( NULL, arg); + config->confdir = make_path(NULL, arg); break; /* ************************************************************************* @@ -1444,12 +1444,12 @@ struct configuration_spec * load_config(void) break; /* *************************************************************************/ - } /* end switch( hash_string(cmd) ) */ + } /* end switch(hash_string(cmd)) */ /* Save the argument for the show-status page. */ savearg(cmd, arg, config); freez(buf); - } /* end while ( read_config_line(...) ) */ + } /* end while (read_config_line(...)) */ fclose(configfp); @@ -1532,9 +1532,9 @@ struct configuration_spec * load_config(void) } #endif /* def FEATURE_TRUST */ - if ( NULL == config->haddr[0] ) + if (NULL == config->haddr[0]) { - config->haddr[0] = strdup( HADDR_DEFAULT ); + config->haddr[0] = strdup(HADDR_DEFAULT); if (NULL == config->haddr[0]) { log_error(LOG_LEVEL_FATAL, "Out of memory while copying default listening address"); @@ -1708,7 +1708,7 @@ static void savearg(char *command, char *argument, struct configuration_spec * c return; } - if ( (NULL != argument) && ('\0' != *argument) ) + if ((NULL != argument) && ('\0' != *argument)) { s = html_encode(argument); if (NULL == s) diff --git a/loaders.c b/loaders.c index a3f91ab8..6d5f54ed 100644 --- a/loaders.c +++ b/loaders.c @@ -1,4 +1,4 @@ -const char loaders_rcs[] = "$Id: loaders.c,v 1.86 2011/09/04 11:10:56 fabiankeil Exp $"; +const char loaders_rcs[] = "$Id: loaders.c,v 1.87 2011/11/06 11:53:15 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loaders.c,v $ @@ -120,7 +120,7 @@ unsigned int sweep(void) unsigned int active_threads = 0; /* clear all of the file's active flags */ - for ( fl = files->next; NULL != fl; fl = fl->next ) + for (fl = files->next; NULL != fl; fl = fl->next) { fl->active = 0; } @@ -221,7 +221,7 @@ unsigned int sweep(void) while (fl != NULL) { - if ( ( 0 == fl->active ) && ( NULL != fl->unloader ) ) + if (( 0 == fl->active) && ( NULL != fl->unloader ) ) { nfl->next = fl->next; @@ -569,7 +569,7 @@ jb_err edit_read_line(FILE *fp, /* Main loop. Loop while we need more data & it's not EOF. */ - while ( (contflag || is_empty) + while ((contflag || is_empty) && (JB_ERR_OK == (rval = simple_read_line(fp, &linebuf, newline)))) { if (line_number) @@ -1316,7 +1316,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) /* * Schedule the now-obsolete old data for unloading */ - if ( NULL != current_re_filterfile[fileid] ) + if (NULL != current_re_filterfile[fileid]) { current_re_filterfile[fileid]->unloader = unload_re_filterfile; } @@ -1329,7 +1329,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) current_re_filterfile[fileid] = fs; csp->rlist[fileid] = fs; - return( 0 ); + return(0); load_re_filterfile_error: log_error(LOG_LEVEL_FATAL, "can't load re_filterfile '%s': %E", diff --git a/miscutil.c b/miscutil.c index 619ff5b5..22e7ec46 100644 --- a/miscutil.c +++ b/miscutil.c @@ -1,4 +1,4 @@ -const char miscutil_rcs[] = "$Id: miscutil.c,v 1.72 2012/03/04 11:51:25 fabiankeil Exp $"; +const char miscutil_rcs[] = "$Id: miscutil.c,v 1.73 2012/03/04 11:52:45 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $ @@ -179,11 +179,11 @@ void write_pid_file(void) * Returns : The string's hash * *********************************************************************/ -unsigned int hash_string( const char* s ) +unsigned int hash_string(const char* s) { unsigned int h = 0; - for ( ; *s; ++s ) + for (; *s; ++s) { h = 5 * h + (unsigned int)*s; } @@ -213,7 +213,7 @@ int strcmpic(const char *s1, const char *s2) while (*s1 && *s2) { - if ( ( *s1 != *s2 ) && ( privoxy_tolower(*s1) != privoxy_tolower(*s2) ) ) + if (( *s1 != *s2) && ( privoxy_tolower(*s1) != privoxy_tolower(*s2) ) ) { break; } @@ -246,7 +246,7 @@ int strncmpic(const char *s1, const char *s2, size_t n) while (*s1 && *s2) { - if ( ( *s1 != *s2 ) && ( privoxy_tolower(*s1) != privoxy_tolower(*s2) ) ) + if (( *s1 != *s2) && ( privoxy_tolower(*s1) != privoxy_tolower(*s2) ) ) { break; } @@ -586,7 +586,7 @@ char * make_path(const char * dir, const char * file) #else /* ifndef _WIN32 || __OS2__ */ || (*file == '/') /* Absolute path (U*ix) */ #endif /* ifndef _WIN32 || __OS2__ */ - ) + ) { return strdup(file); } @@ -596,14 +596,14 @@ char * make_path(const char * dir, const char * file) size_t path_size = strlen(dir) + strlen(file) + 2; /* +2 for trailing (back)slash and \0 */ #if defined(unix) - if ( *dir != '/' && basedir && *basedir ) + if (*dir != '/' && basedir && *basedir) { /* * Relative path, so start with the base directory. */ path_size += strlen(basedir) + 1; /* +1 for the slash */ path = malloc(path_size); - if (!path ) log_error(LOG_LEVEL_FATAL, "malloc failed!"); + if (!path) log_error(LOG_LEVEL_FATAL, "malloc failed!"); strlcpy(path, basedir, path_size); strlcat(path, "/", path_size); strlcat(path, dir, path_size); @@ -612,7 +612,7 @@ char * make_path(const char * dir, const char * file) #endif /* defined unix */ { path = malloc(path_size); - if (!path ) log_error(LOG_LEVEL_FATAL, "malloc failed!"); + if (!path) log_error(LOG_LEVEL_FATAL, "malloc failed!"); strlcpy(path, dir, path_size); } @@ -1374,7 +1374,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { 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 @@ -1385,7 +1385,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { /* 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; @@ -1397,7 +1397,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { * 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). */ @@ -1437,7 +1437,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { 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; } } @@ -1452,7 +1452,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { && !(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 diff --git a/parsers.c b/parsers.c index b4015422..f34ebd12 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.242 2012/03/04 11:51:25 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.243 2012/03/04 11:53:26 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -1480,14 +1480,14 @@ static jb_err filter_header(struct client_state *csp, char **header) for (job = joblist; NULL != job; job = job->next) { matches = pcrs_execute(job, *header, size, &newheader, &size); - if ( 0 < matches ) + if (0 < matches) { current_hits += matches; log_error(LOG_LEVEL_HEADER, "Transforming \"%s\" to \"%s\"", *header, newheader); freez(*header); *header = newheader; } - else if ( 0 == matches ) + else if (0 == matches) { /* Filter doesn't change header */ freez(newheader); @@ -1553,7 +1553,7 @@ static jb_err server_connection(struct client_state *csp, char **header) #ifdef FEATURE_CONNECTION_KEEP_ALIVE && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) #endif - ) + ) { #ifdef FEATURE_CONNECTION_KEEP_ALIVE if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)) @@ -2447,7 +2447,7 @@ static jb_err server_last_modified(struct client_state *csp, char **header) newval = csp->action->string[ACTION_STRING_LAST_MODIFIED]; - if (0 == strcmpic(newval, "block") ) + if (0 == strcmpic(newval, "block")) { /* * Blocking Last-Modified header. Useless but why not. @@ -2743,7 +2743,7 @@ static jb_err client_accept_language(struct client_state *csp, char **header) newval = csp->action->string[ACTION_STRING_LANGUAGE]; - if ((newval == NULL) || (0 == strcmpic(newval, "block")) ) + if ((newval == NULL) || (0 == strcmpic(newval, "block"))) { /* * Blocking Accept-Language header @@ -2920,7 +2920,7 @@ static jb_err client_from(struct client_state *csp, char **header) /* * Are we blocking the e-mail address? */ - if ((newval == NULL) || (0 == strcmpic(newval, "block")) ) + if ((newval == NULL) || (0 == strcmpic(newval, "block"))) { log_error(LOG_LEVEL_HEADER, "crunched From!"); return JB_ERR_OK; @@ -3173,7 +3173,7 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) const char *newval; char * endptr; - if ( 0 == strcmpic(*header, "If-Modified-Since: Wed, 08 Jun 1955 12:00:00 GMT")) + if (0 == strcmpic(*header, "If-Modified-Since: Wed, 08 Jun 1955 12:00:00 GMT")) { /* * The client got an error message because of a temporary problem, @@ -3320,7 +3320,7 @@ static jb_err client_if_none_match(struct client_state *csp, char **header) *********************************************************************/ jb_err client_x_filter(struct client_state *csp, char **header) { - if ( 0 == strcmpic(*header, "X-Filter: No")) + if (0 == strcmpic(*header, "X-Filter: No")) { if (!(csp->config->feature_flags & RUNTIME_FEATURE_HTTP_TOGGLE)) { @@ -3407,7 +3407,7 @@ static jb_err client_host_adder(struct client_state *csp) return JB_ERR_OK; } - if ( !csp->http->hostport || !*(csp->http->hostport)) + if (!csp->http->hostport || !*(csp->http->hostport)) { /* XXX: When does this happen and why is it OK? */ log_error(LOG_LEVEL_INFO, "Weirdness in client_host_adder detected and ignored."); @@ -3417,7 +3417,7 @@ static jb_err client_host_adder(struct client_state *csp) /* * remove 'user:pass@' from 'proto://user:pass@host' */ - if ( (p = strchr( csp->http->hostport, '@')) != NULL ) + if ((p = strchr( csp->http->hostport, '@')) != NULL) { p++; } @@ -3550,7 +3550,7 @@ static jb_err server_connection_adder(struct client_state *csp) #ifdef FEATURE_CONNECTION_KEEP_ALIVE && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) #endif - ) + ) { log_error(LOG_LEVEL_HEADER, "A HTTP/1.1 response " "without Connection header implies keep-alive."); diff --git a/pcrs.c b/pcrs.c index 3b16dead..06481277 100644 --- a/pcrs.c +++ b/pcrs.c @@ -1,4 +1,4 @@ -const char pcrs_rcs[] = "$Id: pcrs.c,v 1.37 2011/04/19 13:00:47 fabiankeil Exp $"; +const char pcrs_rcs[] = "$Id: pcrs.c,v 1.38 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/pcrs.c,v $ @@ -447,7 +447,7 @@ pcrs_job *pcrs_free_job(pcrs_job *job) *********************************************************************/ void pcrs_free_joblist(pcrs_job *joblist) { - while ( NULL != (joblist = pcrs_free_job(joblist)) ) {}; + while (NULL != (joblist = pcrs_free_job(joblist))) {}; return; @@ -882,7 +882,7 @@ int pcrs_execute(pcrs_job *job, const char *subject, size_t subject_length, char 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]]; } } diff --git a/ssplit.c b/ssplit.c index 8c0ed510..cea26608 100644 --- a/ssplit.c +++ b/ssplit.c @@ -1,4 +1,4 @@ -const char ssplit_rcs[] = "$Id: ssplit.c,v 1.11 2011/05/22 10:20:05 fabiankeil Exp $"; +const char ssplit_rcs[] = "$Id: ssplit.c,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/ssplit.c,v $ @@ -118,8 +118,8 @@ int ssplit(char *str, const char *delim, char *vec[], size_t vec_len, /* first pointer is the beginning of string */ /* Check if we want to save this field */ - if ( (!dont_save_empty_fields) - || (is_delim[(unsigned)(unsigned char)*str] == 0) ) + if ((!dont_save_empty_fields) + || (is_delim[(unsigned)(unsigned char)*str] == 0)) { /* * We want empty fields, or the first character in this @@ -143,8 +143,8 @@ int ssplit(char *str, const char *delim, char *vec[], size_t vec_len, *str++ = '\0'; /* Check if we want to save this field */ - if ( (!dont_save_empty_fields) - || (is_delim[(unsigned)(unsigned char)*str] == 0) ) + if ((!dont_save_empty_fields) + || (is_delim[(unsigned)(unsigned char)*str] == 0)) { /* * We want empty fields, or the first character in this diff --git a/urlmatch.c b/urlmatch.c index d7c23310..c3aa96e2 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -1,4 +1,4 @@ -const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.66 2011/12/31 14:53:18 fabiankeil Exp $"; +const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.67 2012/03/04 11:51:49 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $ @@ -253,8 +253,8 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr */ 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; } @@ -337,7 +337,7 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr freez(buf); - if ( (http->path == NULL) + if ((http->path == NULL) || (http->hostport == NULL)) { return JB_ERR_MEMORY; @@ -579,9 +579,9 @@ jb_err parse_http_request(const char *req, struct http_request *http) freez(buf); - if ( (http->cmd == NULL) + if ((http->cmd == NULL) || (http->gpc == NULL) - || (http->ver == NULL) ) + || (http->ver == NULL)) { return JB_ERR_MEMORY; } @@ -971,9 +971,9 @@ static int simplematch(const char *pattern, const char *text) /* * Char match, or char range match? */ - if ( (*pat == *txt) + if ((*pat == *txt) || (*pat == '?') - || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8)))) ) + || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8))))) { /* * Success: Go ahead diff --git a/w32log.c b/w32log.c index b0f3c620..d0aa90e7 100644 --- a/w32log.c +++ b/w32log.c @@ -1,4 +1,4 @@ -const char w32log_rcs[] = "$Id: w32log.c,v 1.39 2011/05/27 11:34:16 fabiankeil Exp $"; +const char w32log_rcs[] = "$Id: w32log.c,v 1.40 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32log.c,v $ @@ -641,7 +641,7 @@ HWND CreateHiddenLogOwnerWindow(HINSTANCE hInstance) hwnd = CreateWindow(szWndName, szWndName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, NULL, NULL, hInstance, NULL ); + CW_USEDEFAULT, NULL, NULL, hInstance, NULL); return hwnd; diff --git a/w32taskbar.c b/w32taskbar.c index a485db0f..8f7b5ea0 100644 --- a/w32taskbar.c +++ b/w32taskbar.c @@ -1,4 +1,4 @@ -const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.11 2009/05/16 13:27:20 fabiankeil Exp $"; +const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32taskbar.c,v $ @@ -95,7 +95,7 @@ HWND CreateTrayWindow(HINSTANCE hInstance) g_hwndTrayX = CreateWindow(szWndName, szWndName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, NULL, NULL, hInstance, NULL ); + CW_USEDEFAULT, NULL, NULL, hInstance, NULL); ShowWindow(g_hwndTrayX, SW_HIDE); UpdateWindow(g_hwndTrayX); @@ -134,7 +134,7 @@ BOOL TraySetIcon(HWND hwnd, UINT uID, HICON hicon) nid.uCallbackMessage = 0; nid.hIcon = hicon; - return( Shell_NotifyIcon(NIM_MODIFY, &nid) ); + return(Shell_NotifyIcon(NIM_MODIFY, &nid)); } @@ -172,7 +172,7 @@ BOOL TrayAddIcon(HWND hwnd, UINT uID, HICON hicon, const char *pszToolTip) strcpy(nid.szTip, pszToolTip); } - return( Shell_NotifyIcon(NIM_ADD, &nid) ); + return(Shell_NotifyIcon(NIM_ADD, &nid)); } @@ -200,7 +200,7 @@ BOOL TrayDeleteIcon(HWND hwnd, UINT uID) nid.hWnd = hwnd; nid.uID = uID; - return( Shell_NotifyIcon(NIM_DELETE, &nid) ); + return(Shell_NotifyIcon(NIM_DELETE, &nid)); } @@ -243,7 +243,7 @@ LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 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) { diff --git a/win32.c b/win32.c index c7ebcf3c..92c69a4e 100644 --- a/win32.c +++ b/win32.c @@ -1,4 +1,4 @@ -const char win32_rcs[] = "$Id: win32.c,v 1.17 2010/01/11 11:41:07 fabiankeil Exp $"; +const char win32_rcs[] = "$Id: win32.c,v 1.18 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/win32.c,v $ @@ -141,7 +141,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine /* Visual C++ Heap debugging */ /* Get current flag*/ - int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ); + int tmpFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); /* Turn on leak-checking bit */ tmpFlag |= _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF; @@ -150,7 +150,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine tmpFlag &= ~(_CRTDBG_CHECK_CRT_DF | _CRTDBG_DELAY_FREE_MEM_DF); /* Set flag to the new value */ - _CrtSetDbgFlag( tmpFlag ); + _CrtSetDbgFlag(tmpFlag); #endif #endif /* defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG) */ @@ -208,9 +208,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine #endif #ifdef __MINGW32__ - res = real_main( __argc, __argv ); + res = real_main(__argc, __argv); #else - res = main( __argc, __argv ); + res = main(__argc, __argv); #endif return res;