]> granicus.if.org Git - apache/commitdiff
* server/util_expr_eval.c (ap_expr_eval_re_backref): Fix gcc 7.x warning.
authorJoe Orton <jorton@apache.org>
Mon, 16 Oct 2017 16:40:52 +0000 (16:40 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 16 Oct 2017 16:40:52 +0000 (16:40 +0000)
util_expr_eval.c: In function ‘ap_expr_eval_re_backref’:
util_expr_eval.c:265:63: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
     if (!ctx->re_pmatch || !ctx->re_source || *ctx->re_source == '\0' ||

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1812307 13f79535-47bb-0310-9956-ffa450edef68

server/util_expr_eval.c

index ab36dbd0a9ee611d7c15641c39b3c4d661cbad84..9220acb7498c76a89df1e65d0e99de1db4ddfac5 100644 (file)
@@ -262,8 +262,8 @@ static const char *ap_expr_eval_re_backref(ap_expr_eval_ctx_t *ctx, unsigned int
 {
     int len;
 
-    if (!ctx->re_pmatch || !ctx->re_source || *ctx->re_source == '\0' ||
-        ctx->re_nmatch < n + 1)
+    if (!ctx->re_pmatch || !ctx->re_source || !*ctx->re_source
+        || **ctx->re_source == '\0' || ctx->re_nmatch < n + 1)
         return "";
 
     len = ctx->re_pmatch[n].rm_eo - ctx->re_pmatch[n].rm_so;