From bb69ec6cfe4c08c3bbaddbab0c52381553ac03f7 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 3 Mar 2013 21:25:46 +0000 Subject: [PATCH] Remove useless tests. Turn if (*x && apr_isspace(*x)) into if (apr_isspace(*x)) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1452128 13f79535-47bb-0310-9956-ffa450edef68 --- modules/cache/mod_cache_disk.c | 2 +- modules/filters/mod_proxy_html.c | 2 +- modules/mappers/mod_imagemap.c | 2 +- modules/mappers/mod_negotiation.c | 8 ++++---- modules/mappers/mod_rewrite.c | 2 +- modules/metadata/mod_cern_meta.c | 2 +- modules/metadata/mod_headers.c | 2 +- server/util.c | 8 ++++---- server/util_script.c | 2 +- support/httxt2dbm.c | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/cache/mod_cache_disk.c b/modules/cache/mod_cache_disk.c index 8427e8fd60..c050e76ab8 100644 --- a/modules/cache/mod_cache_disk.c +++ b/modules/cache/mod_cache_disk.c @@ -841,7 +841,7 @@ static apr_status_t read_table(cache_handle_t *handle, request_rec *r, } *l++ = '\0'; - while (*l && apr_isspace(*l)) { + while (apr_isspace(*l)) { ++l; } diff --git a/modules/filters/mod_proxy_html.c b/modules/filters/mod_proxy_html.c index 15a601a548..7906645a67 100644 --- a/modules/filters/mod_proxy_html.c +++ b/modules/filters/mod_proxy_html.c @@ -670,7 +670,7 @@ static meta *metafix(request_rec *r, const char *buf) if (p != NULL) { while (*p) { p += 7; - while (*p && apr_isspace(*p)) + while (apr_isspace(*p)) ++p; if (*p != '=') continue; diff --git a/modules/mappers/mod_imagemap.c b/modules/mappers/mod_imagemap.c index 1857760b37..65b9eb15d2 100644 --- a/modules/mappers/mod_imagemap.c +++ b/modules/mappers/mod_imagemap.c @@ -686,7 +686,7 @@ static int imap_handler_internal(request_rec *r) if (!*string_pos) { /* need at least two fields */ goto need_2_fields; } - while(*string_pos && apr_isspace(*string_pos)) { /* past whitespace */ + while (apr_isspace(*string_pos)) { /* past whitespace */ ++string_pos; } diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 4a3a45730e..5ec0d4d02d 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -366,7 +366,7 @@ static float atoq(const char *string) return 1.0f; } - while (*string && apr_isspace(*string)) { + while (apr_isspace(*string)) { ++string; } @@ -464,7 +464,7 @@ static const char *get_entry(apr_pool_t *p, accept_rec *result, } *cp++ = '\0'; /* Delimit var */ - while (*cp && (apr_isspace(*cp) || *cp == '=')) { + while (apr_isspace(*cp) || *cp == '=') { ++cp; } @@ -757,7 +757,7 @@ static enum header_state get_header_line(char *buffer, int len, apr_file_t *map) /* If blank, just return it --- this ends information on this variant */ - for (cp = buffer; (*cp && apr_isspace(*cp)); ++cp) { + for (cp = buffer; apr_isspace(*cp); ++cp) { continue; } @@ -924,7 +924,7 @@ static char *lcase_header_name_return_body(char *header, request_rec *r) do { ++cp; - } while (*cp && apr_isspace(*cp)); + } while (apr_isspace(*cp)); if (!*cp) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00682) diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 4fa90546c1..a7ac2134b8 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1255,7 +1255,7 @@ static char *lookup_map_txtfile(request_rec *r, const char *file, char *key) } /* jump to the value */ - while (*p && apr_isspace(*p)) { + while (apr_isspace(*p)) { ++p; } diff --git a/modules/metadata/mod_cern_meta.c b/modules/metadata/mod_cern_meta.c index fe704f1a12..f06c464c1d 100644 --- a/modules/metadata/mod_cern_meta.c +++ b/modules/metadata/mod_cern_meta.c @@ -237,7 +237,7 @@ static int scan_meta_file(request_rec *r, apr_file_t *f) } *l++ = '\0'; - while (*l && apr_isspace(*l)) + while (apr_isspace(*l)) ++l; if (!strcasecmp(w, "Content-type")) { diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index 93977390b9..9ce2fdec67 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -722,7 +722,7 @@ static int do_headers_fixup(request_rec *r, apr_table_t *headers, while (*val) { const char *tok_start; - while (*val && apr_isspace(*val)) + while (apr_isspace(*val)) ++val; tok_start = val; diff --git a/server/util.c b/server/util.c index b6a83275fb..46741dd8b1 100644 --- a/server/util.c +++ b/server/util.c @@ -784,7 +784,7 @@ AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line) char *res; char quote; - while (*str && apr_isspace(*str)) + while (apr_isspace(*str)) ++str; if (!*str) { @@ -816,7 +816,7 @@ AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line) res = substring_conf(p, str, strend - str, 0); } - while (*strend && apr_isspace(*strend)) + while (apr_isspace(*strend)) ++strend; *line = strend; return res; @@ -1406,7 +1406,7 @@ AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, /* Find first non-white byte */ - while (*ptr && apr_isspace(*ptr)) + while (apr_isspace(*ptr)) ++ptr; tok_start = ptr; @@ -1428,7 +1428,7 @@ AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, /* Advance accept_line pointer to the next non-white byte */ - while (*ptr && apr_isspace(*ptr)) + while (apr_isspace(*ptr)) ++ptr; *accept_line = ptr; diff --git a/server/util_script.c b/server/util_script.c index 2dcb06d62a..3bc1b00a63 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -566,7 +566,7 @@ AP_DECLARE(int) ap_scan_script_header_err_core_ex(request_rec *r, char *buffer, } *l++ = '\0'; - while (*l && apr_isspace(*l)) { + while (apr_isspace(*l)) { ++l; } diff --git a/support/httxt2dbm.c b/support/httxt2dbm.c index 12606c3a5e..0a129dcea0 100644 --- a/support/httxt2dbm.c +++ b/support/httxt2dbm.c @@ -138,7 +138,7 @@ static apr_status_t to_dbm(apr_dbm_t *dbm, apr_file_t *fp, apr_pool_t *pool) dbmkey.dptr = apr_pstrmemdup(p, line, c - line); dbmkey.dsize = (c - line); - while (*c && apr_isspace(*c)) { + while (apr_isspace(*c)) { ++c; } -- 2.40.0