Browse Source

Save a couple characters' allocation in esc_for_log

Florian Zumbiehl 14 years ago
parent
commit
426116113f
2 changed files with 6 additions and 0 deletions
  1. 3 0
      changes/less_alloc_for_esc
  2. 3 0
      src/common/util.c

+ 3 - 0
changes/less_alloc_for_esc

@@ -0,0 +1,3 @@
+ o Minor bugfixes
+   - Save a couple bytes in memory allocation every time we escape
+     certain characters in a string.  Patch from Florian Zumbiehl.

+ 3 - 0
src/common/util.c

@@ -940,6 +940,9 @@ esc_for_log(const char *s)
       case '\\':
       case '\"':
       case '\'':
+      case '\r':
+      case '\n':
+      case '\t':
         len += 2;
         break;
       default: