Skip to content

Commit

Permalink
ARROW-7934 : [C++] Fix UriEscape for empty string
Browse files Browse the repository at this point in the history
Closes #6486 from projjal/fixuri and squashes the following commits:

4eaa765 <Antoine Pitrou> Add explanatory comment
b094c92 <Projjal Chanda> fix uri escape for empty string

Lead-authored-by: Projjal Chanda <iam@pchanda.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
projjal and pitrou committed Feb 25, 2020
1 parent d2ab289 commit 2f9e348
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpp/src/arrow/util/uri.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ bool IsTextRangeSet(const UriTextRangeStructA& range) { return range.first != nu
} // namespace

std::string UriEscape(const std::string& s) {
if (s.empty()) {
// Avoid passing null pointer to uriEscapeExA
return s;
}
std::string escaped;
escaped.resize(3 * s.length());

Expand Down

0 comments on commit 2f9e348

Please sign in to comment.