* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
if(!str)
return NULL;
- /* Count any unescapped characters */
+ /* Count any unescaped characters */
p1 = str;
while(*p1) {
if(*p1 == '\\')
p1++;
}
- /* Does the input contain any unescapped characters? */
+ /* Does the input contain any unescaped characters? */
if(!backsp_count && !quote_count && !space_exists)
return strdup(str);
if(*p) {
char *dn = p;
- char *unescapped;
+ char *unescaped;
LDAP_TRACE (("DN '%s'\n", dn));
/* Unescape the DN */
- unescapped = curl_easy_unescape(conn->data, dn, 0, NULL);
- if(!unescapped) {
+ unescaped = curl_easy_unescape(conn->data, dn, 0, NULL);
+ if(!unescaped) {
rc = LDAP_NO_MEMORY;
goto quit;
}
#if defined(CURL_LDAP_WIN)
- /* Convert the unescapped string to a tchar */
- ludp->lud_dn = Curl_convert_UTF8_to_tchar(unescapped);
+ /* Convert the unescaped string to a tchar */
+ ludp->lud_dn = Curl_convert_UTF8_to_tchar(unescaped);
- /* Free the unescapped string as we are done with it */
- Curl_unicodefree(unescapped);
+ /* Free the unescaped string as we are done with it */
+ Curl_unicodefree(unescaped);
if(!ludp->lud_dn) {
rc = LDAP_NO_MEMORY;
goto quit;
}
#else
- ludp->lud_dn = unescapped;
+ ludp->lud_dn = unescaped;
#endif
}
}
for(i = 0; i < count; i++) {
- char *unescapped;
+ char *unescaped;
LDAP_TRACE (("attr[%d] '%s'\n", i, attributes[i]));
/* Unescape the attribute */
- unescapped = curl_easy_unescape(conn->data, attributes[i], 0, NULL);
- if(!unescapped) {
+ unescaped = curl_easy_unescape(conn->data, attributes[i], 0, NULL);
+ if(!unescaped) {
Curl_safefree(attributes);
rc = LDAP_NO_MEMORY;
}
#if defined(CURL_LDAP_WIN)
- /* Convert the unescapped string to a tchar */
- ludp->lud_attrs[i] = Curl_convert_UTF8_to_tchar(unescapped);
+ /* Convert the unescaped string to a tchar */
+ ludp->lud_attrs[i] = Curl_convert_UTF8_to_tchar(unescaped);
- /* Free the unescapped string as we are done with it */
- Curl_unicodefree(unescapped);
+ /* Free the unescaped string as we are done with it */
+ Curl_unicodefree(unescaped);
if(!ludp->lud_attrs[i]) {
Curl_safefree(attributes);
goto quit;
}
#else
- ludp->lud_attrs[i] = unescapped;
+ ludp->lud_attrs[i] = unescaped;
#endif
ludp->lud_attrs_dups++;
if(*p) {
char *filter = p;
- char *unescapped;
+ char *unescaped;
LDAP_TRACE (("filter '%s'\n", filter));
/* Unescape the filter */
- unescapped = curl_easy_unescape(conn->data, filter, 0, NULL);
- if(!unescapped) {
+ unescaped = curl_easy_unescape(conn->data, filter, 0, NULL);
+ if(!unescaped) {
rc = LDAP_NO_MEMORY;
goto quit;
}
#if defined(CURL_LDAP_WIN)
- /* Convert the unescapped string to a tchar */
- ludp->lud_filter = Curl_convert_UTF8_to_tchar(unescapped);
+ /* Convert the unescaped string to a tchar */
+ ludp->lud_filter = Curl_convert_UTF8_to_tchar(unescaped);
- /* Free the unescapped string as we are done with it */
- Curl_unicodefree(unescapped);
+ /* Free the unescaped string as we are done with it */
+ Curl_unicodefree(unescaped);
if(!ludp->lud_filter) {
rc = LDAP_NO_MEMORY;
goto quit;
}
#else
- ludp->lud_filter = unescapped;
+ ludp->lud_filter = unescaped;
#endif
}