]> git.pld-linux.org Git - packages/lighttpd.git/commitdiff
- format " properly in accesslog format when printing config with lighttpd -pf CONFIG...
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 24 May 2010 22:08:34 +0000 (22:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    data_string_print_escape.patch -> 1.1

data_string_print_escape.patch [new file with mode: 0644]

diff --git a/data_string_print_escape.patch b/data_string_print_escape.patch
new file mode 100644 (file)
index 0000000..4091aa1
--- /dev/null
@@ -0,0 +1,23 @@
+--- lighttpd-1.4.26/src/data_string.c~ 2010-05-25 00:53:55.000000000 +0300
++++ lighttpd-1.4.26/src/data_string.c  2010-05-25 00:53:59.407739779 +0300
+@@ -70,8 +70,19 @@
+ static void data_string_print(const data_unset *d, int depth) {
+       data_string *ds = (data_string *)d;
+       UNUSED(depth);
++      unsigned int i = 0;
+-      fprintf(stdout, "\"%s\"", ds->value->used ? ds->value->ptr : "");
++      // print out the string as is, except prepend " with backslash
++      putc('"', stdout);
++      for (i = 0; i < ds->value->used - 1; i++) {
++              unsigned char c = ds->value->ptr[i];
++              if (c == '"') {
++                      fputs("\\\"", stdout);
++              } else {
++                      putc(c, stdout);
++              }
++      }
++      putc('"', stdout);
+ }
This page took 0.158286 seconds and 4 git commands to generate.