diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-09-08 20:07:34 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-09-08 20:07:34 -0500 |
commit | 93699a27f747cb373ada71e649996fc16e1bee96 (patch) | |
tree | ab637534a8fc9c2cb27f6a1ce03728231c778b89 /external | |
parent | Merge pull request #5856 (diff) | |
parent | ITS#9068 fix backslash escaping (diff) | |
download | monero-93699a27f747cb373ada71e649996fc16e1bee96.tar.xz |
Merge pull request #5857
e907305 ITS#9068 fix backslash escaping (hyc)
Diffstat (limited to 'external')
-rw-r--r-- | external/db_drivers/liblmdb/mdb_dump.c | 2 | ||||
-rw-r--r-- | external/db_drivers/liblmdb/mdb_load.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/external/db_drivers/liblmdb/mdb_dump.c b/external/db_drivers/liblmdb/mdb_dump.c index b7737f12d..068dab5a8 100644 --- a/external/db_drivers/liblmdb/mdb_dump.c +++ b/external/db_drivers/liblmdb/mdb_dump.c @@ -64,6 +64,8 @@ static void text(MDB_val *v) end = c + v->mv_size; while (c < end) { if (isprint(*c)) { + if (*c == '\\') + putchar('\\'); putchar(*c); } else { putchar('\\'); diff --git a/external/db_drivers/liblmdb/mdb_load.c b/external/db_drivers/liblmdb/mdb_load.c index ad911c088..e900ae660 100644 --- a/external/db_drivers/liblmdb/mdb_load.c +++ b/external/db_drivers/liblmdb/mdb_load.c @@ -236,7 +236,7 @@ badend: while (c2 < end) { if (*c2 == '\\') { if (c2[1] == '\\') { - c1++; c2 += 2; + *c1++ = *c2; } else { if (c2+3 > end || !isxdigit(c2[1]) || !isxdigit(c2[2])) { Eof = 1; @@ -244,8 +244,8 @@ badend: return EOF; } *c1++ = unhex(++c2); - c2 += 2; } + c2 += 2; } else { /* copies are redundant when no escapes were used */ *c1++ = *c2++; |