diff options
author | Aravinda VK <avishwan@redhat.com> | 2017-07-03 14:51:21 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2017-07-21 04:43:58 +0000 |
commit | 5353389faf77bb2edb54e785c3d8aca323188dad (patch) | |
tree | 0f6edac0296bd5c097798443e318817dbcceb120 /xlators/features/changelog/lib/src/gf-changelog-journal-handler.c | |
parent | 7517ee8a5795a85c1a877992c213199b0fd85517 (diff) |
features/libgfchangelog: Fix encoding to encode only space and newline
libgfchangelog was encoding path using spec rfc3986, but encoding only
required for SPACE and NEWLINE chars since the NEWLINE char is used as
record separator and SPACE as field separator in the parsed changelogs
output.
Changed the encoding function to encode only SPACE and NEWLINE.
BUG: 1451724
Change-Id: I4305459aab9e710517dd3eb065f0024503064b77
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: https://review.gluster.org/17674
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/features/changelog/lib/src/gf-changelog-journal-handler.c')
-rw-r--r-- | xlators/features/changelog/lib/src/gf-changelog-journal-handler.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c index e490069a165..f2fc25cc671 100644 --- a/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c +++ b/xlators/features/changelog/lib/src/gf-changelog-journal-handler.c @@ -392,8 +392,10 @@ gf_changelog_parse_ascii (xlator_t *this, break; } - gf_rfc3986_encode ((unsigned char *) ptr, - eptr, jnl->rfc3986); + gf_rfc3986_encode_space_newline ( + (unsigned char *) ptr, + eptr, + jnl->rfc3986_space_newline); FILL_AND_MOVE (eptr, ascii, off, mover, nleft, len); free (eptr); @@ -955,9 +957,8 @@ gf_changelog_init_history (xlator_t *this, jnl->hist_jnl->jnl_brickpath[PATH_MAX-1] = 0; for (i = 0; i < 256; i++) { - jnl->hist_jnl->rfc3986[i] = - (isalnum(i) || i == '~' || - i == '-' || i == '.' || i == '_') ? i : 0; + jnl->hist_jnl->rfc3986_space_newline[i] = + (i == ' ' || i == '\n' || i == '%') ? 0 : i; } return 0; @@ -1026,9 +1027,8 @@ gf_changelog_journal_init (void *xl, struct gf_brick_spec *brick) /* RFC 3986 {de,en}coding */ for (i = 0; i < 256; i++) { - jnl->rfc3986[i] = - (isalnum(i) || i == '~' || - i == '-' || i == '.' || i == '_') ? i : 0; + jnl->rfc3986_space_newline[i] = + (i == ' ' || i == '\n' || i == '%') ? 0 : i; } ret = gf_changelog_init_history (this, jnl, brick->brick_path); |