aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-07-18 08:45:13 -0400
committerNick Mathewson <nickm@torproject.org>2013-07-18 08:45:13 -0400
commitb551988ef46ac29427a3bd8d8a76965b190623ab (patch)
treeebb700b59bc4e5f732514855b48b2b626db4312d /src/common
parentdd44ff663e074d07a8bf8b94dc5d8b9d8dc3fb32 (diff)
parent8a01a7c35b422a2c22fad2ee71f0268aa1b28b85 (diff)
downloadtor-b551988ef46ac29427a3bd8d8a76965b190623ab.tar.gz
tor-b551988ef46ac29427a3bd8d8a76965b190623ab.zip
Merge branch 'bug8929_rebase_2'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/util.c9
-rw-r--r--src/common/util.h3
2 files changed, 5 insertions, 7 deletions
diff --git a/src/common/util.c b/src/common/util.c
index d9913dda45..0e8d34eafd 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1223,17 +1223,14 @@ escaped(const char *s)
return escaped_val_;
}
-/** Escape every ";" or "\" character of <b>string</b>. Use
- * <b>escape_char</b> as the character to use for escaping.
- * The returned string is allocated on the heap and it's the
- * responsibility of the caller to free it. */
+/** Return a newly allocated string equal to <b>string</b>, except that every
+ * character in <b>chars_to_escape</b> is preceded by a backslash. */
char *
-tor_escape_str_for_socks_arg(const char *string)
+tor_escape_str_for_pt_args(const char *string, const char *chars_to_escape)
{
char *new_string = NULL;
char *new_cp = NULL;
size_t length, new_length;
- static const char *chars_to_escape = ";\\";
tor_assert(string);
diff --git a/src/common/util.h b/src/common/util.h
index ad75266587..0a8e4a23fc 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -231,7 +231,8 @@ int tor_digest256_is_zero(const char *digest);
char *esc_for_log(const char *string) ATTR_MALLOC;
const char *escaped(const char *string);
-char *tor_escape_str_for_socks_arg(const char *string);
+char *tor_escape_str_for_pt_args(const char *string,
+ const char *chars_to_escape);
struct smartlist_t;
int tor_vsscanf(const char *buf, const char *pattern, va_list ap) \