]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Remove unneeded checks to improve performance
authorRuediger Pluem <rpluem@apache.org>
Wed, 18 Aug 2021 14:53:14 +0000 (14:53 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 18 Aug 2021 14:53:14 +0000 (14:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892422 13f79535-47bb-0310-9956-ffa450edef68

server/util.c

index 6bc5063bc399acba52dd15dfa9df10cde7efe84e..d56af387671cdc572d56f28277a54f4bb28346a4 100644 (file)
@@ -2607,7 +2607,7 @@ AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring)
          * If we find a slosh, and it's not the last byte in the string,
          * it's escaping something - advance past both bytes.
          */
-        if ((*inchr == '\\') && (inchr[1] != '\0')) {
+        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
             inchr++;
             newlen++;
         }
@@ -2624,12 +2624,10 @@ AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring)
         if (*inchr == '"') {
             *outchr++ = '\\';
         }
-        if ((*inchr == '\\') && (inchr[1] != '\0')) {
-            *outchr++ = *inchr++;
-        }
-        if (*inchr != '\0') {
+        else if ((*inchr == '\\') && (inchr[1] != '\0')) {
             *outchr++ = *inchr++;
         }
+        *outchr++ = *inchr++;
     }
     *outchr = '\0';
     return outstring;