summaryrefslogtreecommitdiff
path: root/cups/http-support.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-04-09 22:42:49 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-04-09 22:42:49 +0000
commit839a51c83c61febe8d4c9ba56f6a05fce3d03710 (patch)
treef4a78140580870e06a5d95257d979990e12155ab /cups/http-support.c
parent50fe720154d2af59cdeeaecf05cc868530e16248 (diff)
Merge changes from CUPS 1.4svn-r7394.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@702 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/http-support.c')
-rw-r--r--cups/http-support.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/cups/http-support.c b/cups/http-support.c
index be6cfbe84..a8d58b0be 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -36,6 +36,7 @@
* httpStatus() - Return a short string describing a HTTP status code.
* _cups_hstrerror() - hstrerror() emulation function for Solaris and
* others...
+ * _httpEncodeURI() - Percent-encode a HTTP request URI.
* http_copy_decode() - Copy and decode a URI.
* http_copy_encode() - Copy and encode a URI.
*/
@@ -1204,6 +1205,20 @@ _cups_hstrerror(int error) /* I - Error number */
/*
+ * '_httpEncodeURI()' - Percent-encode a HTTP request URI.
+ */
+
+char * /* O - Encoded URI */
+_httpEncodeURI(char *dst, /* I - Destination buffer */
+ const char *src, /* I - Source URI */
+ size_t dstsize) /* I - Size of destination buffer */
+{
+ http_copy_encode(dst, src, dst + dstsize - 1, NULL, NULL, 1);
+ return (dst);
+}
+
+
+/*
* 'http_copy_decode()' - Copy and decode a URI.
*/
@@ -1311,6 +1326,8 @@ http_copy_encode(char *dst, /* O - Destination buffer */
*dst++ = *src++;
}
+ *dst = '\0';
+
if (*src)
return (NULL);
else