Merge branch 'master' into lukeh/moonshot

Conflicts:
	lib/gssapi/krb5/external.c
	lib/libedit/src/vi.c
This commit is contained in:
Luke Howard
2011-05-12 13:04:55 +02:00
221 changed files with 2074 additions and 2100 deletions

View File

@@ -608,11 +608,11 @@ TerminalSpeeds(long *input_speed, long *output_speed)
int
TerminalWindowSize(long *rows, long *cols)
{
struct winsize ws;
int irows, icols;
if (get_window_size (STDIN_FILENO, &ws) == 0) {
*rows = ws.ws_row;
*cols = ws.ws_col;
if (get_window_size(STDIN_FILENO, &irows, &icols) == 0) {
*rows = irows;
*cols = icols;
return 1;
} else
return 0;

View File

@@ -237,12 +237,16 @@ http_query(const char *host, const char *page,
in_ptr -= 2;
break;
} else if (state == RESPONSE) {
req->response = strndup(in_buf, p - in_buf);
req->response = emalloc(p - in_buf + 1);
memcpy(req->response, in_buf, p - in_buf);
req->response[p - in_buf] = '\0';
state = HEADER;
} else {
req->headers = realloc(req->headers,
(req->num_headers + 1) * sizeof(req->headers[0]));
req->headers[req->num_headers] = strndup(in_buf, p - in_buf);
req->headers[req->num_headers] = emalloc(p - in_buf + 1);
memcpy(req->headers[req->num_headers], in_buf, p - in_buf);
req->headers[req->num_headers][p - in_buf] = '\0';
if (req->headers[req->num_headers] == NULL)
errx(1, "strdup");
req->num_headers++;