View | Details | Raw Unified | Return to bug 56833
Collapse All | Expand All

(-)neon-0.23.7/libneon/ne_session.c (-1 / +14 lines)
Lines 33-38 Link Here
33
#ifdef HAVE_STDLIB_H
33
#ifdef HAVE_STDLIB_H
34
#include <stdlib.h>
34
#include <stdlib.h>
35
#endif
35
#endif
36
#include <ctype.h> /* for cleanse() */
37
36
38
37
#include "ne_session.h"
39
#include "ne_session.h"
38
#include "ne_alloc.h"
40
#include "ne_alloc.h"
Lines 242-250 Link Here
242
}
244
}
243
245
244
246
247
/* Cleanse 'str' of non-printable characters.  Duplicated in
248
 * ne_utils.c for the duration of neon 0.23.x to prevent ABI
249
 * change. */
250
static char *cleanse(char *str)
251
{
252
    char *pnt;
253
    for (pnt = str; *pnt; pnt++)
254
        if (iscntrl(*pnt) || !isprint(*pnt)) *pnt = ' ';
255
    return str;
256
}
257
245
const char *ne_get_error(ne_session *sess) {
258
const char *ne_get_error(ne_session *sess) {
246
    return sess->error;
259
    return cleanse(sess->error);
247
}
260
}
248
261
249
int ne_close_connection(ne_session *sess)
262
int ne_close_connection(ne_session *sess)
(-)neon-0.23.7/libneon/ne_utils.c (-1 / +13 lines)
Lines 31-36 Link Here
31
#include <ctype.h> /* isdigit() for ne_parse_statusline */
31
#include <ctype.h> /* isdigit() for ne_parse_statusline */
32
32
33
#include "ne_utils.h"
33
#include "ne_utils.h"
34
#include "ne_alloc.h"
34
35
35
#include "ne_dates.h"
36
#include "ne_dates.h"
36
37
Lines 129-134 int ne_supports_ssl(void) Link Here
129
#endif
129
#endif
130
}
130
}
131
131
132
/* Cleanse 'str' of non-printable characters.  Duplicated in
133
 * ne_session.c for the duration of neon 0.23.x to prevent ABI
134
 * change. */
135
static char *cleanse(char *str)
136
{
137
    char *pnt;
138
    for (pnt = str; *pnt; pnt++)
139
        if (iscntrl(*pnt) || !isprint(*pnt)) *pnt = ' ';
140
    return str;
141
}
142
132
int ne_parse_statusline(const char *status_line, ne_status *st)
143
int ne_parse_statusline(const char *status_line, ne_status *st)
133
{
144
{
134
    const char *part;
145
    const char *part;
Lines 177-183 int ne_parse_statusline(const char *stat Link Here
177
    /* Fill in the results */
188
    /* Fill in the results */
178
    st->major_version = major;
189
    st->major_version = major;
179
    st->minor_version = minor;
190
    st->minor_version = minor;
180
    st->reason_phrase = part;
191
    st->reason_phrase = cleanse(ne_strdup(part));
181
    st->code = status_code;
192
    st->code = status_code;
182
    st->klass = klass;
193
    st->klass = klass;
183
    return 0;
194
    return 0;

Return to bug 56833