You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ni...@apache.org on 2015/08/31 19:32:38 UTC

trafficserver git commit: stream_editor: #define WHITESPACE rather than spell it out every time

Repository: trafficserver
Updated Branches:
  refs/heads/master 7a1b150ac -> b4ff34887


stream_editor: #define WHITESPACE rather than spell it out every time


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b4ff3488
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b4ff3488
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b4ff3488

Branch: refs/heads/master
Commit: b4ff34887211f85724d43e15dfc21860b7d8f4e1
Parents: 7a1b150
Author: Nick Kew <nk...@qualys.com>
Authored: Mon Aug 31 18:31:38 2015 +0100
Committer: Nick Kew <nk...@qualys.com>
Committed: Mon Aug 31 18:31:38 2015 +0100

----------------------------------------------------------------------
 plugins/experimental/stream_editor/stream_editor.cc | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b4ff3488/plugins/experimental/stream_editor/stream_editor.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/stream_editor/stream_editor.cc b/plugins/experimental/stream_editor/stream_editor.cc
index 6ef6ae5..d828218 100644
--- a/plugins/experimental/stream_editor/stream_editor.cc
+++ b/plugins/experimental/stream_editor/stream_editor.cc
@@ -86,6 +86,7 @@
  */
 #define MAX_CONFIG_LINE 1024
 #define MAX_RX_MATCH 10
+#define WHITESPACE " \t\r\n"
 
 #include <stdint.h>
 
@@ -432,14 +433,14 @@ public:
     }
     delim = *++from_spec;
     if (isalnum(delim)) {
-      len = strcspn(from_spec, " \t\r\n");
+      len = strcspn(from_spec, WHITESPACE);
     } else {
       const char *end = strchr(++from_spec, delim);
       if (end) {
         len = end - from_spec;
       } else {
         /* it wasn't a delimiter after all */
-        len = strcspn(--from_spec, " \t\r\n");
+        len = strcspn(--from_spec, WHITESPACE);
       }
     }
     if (rx) {
@@ -466,7 +467,7 @@ public:
         }
       }
       ++scope_spec;
-      len = strcspn(scope_spec, " 	");
+      len = strcspn(scope_spec, WHITESPACE);
       if (rx) {
         scope = new rxscope(uri, icase, scope_spec, len);
       } else {
@@ -484,14 +485,14 @@ public:
     to_spec += 3;
     delim = *to_spec;
     if (isalnum(delim)) {
-      len = strcspn(to_spec, " \t\r\n");
+      len = strcspn(to_spec, WHITESPACE);
     } else {
       const char *end = strchr(++to_spec, delim);
       if (end) {
         len = end - to_spec;
       } else {
         /* it wasn't a delimiter after all */
-        len = strcspn(--to_spec, " \t\r\n");
+        len = strcspn(--to_spec, WHITESPACE);
       }
     }
     to = TSstrndup(to_spec, len);