From c60d7697d15be22e54d2f88fd5d0a178a192fb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 21 Jul 2018 09:49:34 +0200 Subject: pkt-line.c: mark more strings for translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- pkt-line.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pkt-line.c b/pkt-line.c index 941e41dfc1..04d10bbd03 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -101,7 +101,7 @@ int packet_flush_gently(int fd) { packet_trace("0000", 4, 1); if (write_in_full(fd, "0000", 4) < 0) - return error("flush packet write failed"); + return error(_("flush packet write failed")); return 0; } @@ -139,7 +139,7 @@ static void format_packet(struct strbuf *out, const char *fmt, va_list args) n = out->len - orig_len; if (n > LARGE_PACKET_MAX) - die("protocol error: impossibly long line"); + die(_("protocol error: impossibly long line")); set_packet_header(&out->buf[orig_len], n); packet_trace(out->buf + orig_len + 4, n - 4, 1); @@ -155,9 +155,9 @@ static int packet_write_fmt_1(int fd, int gently, if (write_in_full(fd, buf.buf, buf.len) < 0) { if (!gently) { check_pipe(errno); - die_errno("packet write with format failed"); + die_errno(_("packet write with format failed")); } - return error("packet write with format failed"); + return error(_("packet write with format failed")); } return 0; @@ -189,21 +189,21 @@ static int packet_write_gently(const int fd_out, const char *buf, size_t size) size_t packet_size; if (size > sizeof(packet_write_buffer) - 4) - return error("packet write failed - data exceeds max packet size"); + return error(_("packet write failed - data exceeds max packet size")); packet_trace(buf, size, 1); packet_size = size + 4; set_packet_header(packet_write_buffer, packet_size); memcpy(packet_write_buffer + 4, buf, size); if (write_in_full(fd_out, packet_write_buffer, packet_size) < 0) - return error("packet write failed"); + return error(_("packet write failed")); return 0; } void packet_write(int fd_out, const char *buf, size_t size) { if (packet_write_gently(fd_out, buf, size)) - die_errno("packet write failed"); + die_errno(_("packet write failed")); } void packet_buf_write(struct strbuf *buf, const char *fmt, ...) @@ -225,7 +225,7 @@ void packet_buf_write_len(struct strbuf *buf, const char *data, size_t len) n = buf->len - orig_len; if (n > LARGE_PACKET_MAX) - die("protocol error: impossibly long line"); + die(_("protocol error: impossibly long line")); set_packet_header(&buf->buf[orig_len], n); packet_trace(data, len, 1); @@ -288,7 +288,7 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size, } else { ret = read_in_full(fd, dst, size); if (ret < 0) - die_errno("read error"); + die_errno(_("read error")); } /* And complain if we didn't get enough bytes to satisfy the read. */ @@ -296,7 +296,7 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size, if (options & PACKET_READ_GENTLE_ON_EOF) return -1; - die("the remote end hung up unexpectedly"); + die(_("the remote end hung up unexpectedly")); } return ret; @@ -324,7 +324,7 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer, len = packet_length(linelen); if (len < 0) { - die("protocol error: bad line length character: %.4s", linelen); + die(_("protocol error: bad line length character: %.4s"), linelen); } else if (!len) { packet_trace("0000", 4, 0); *pktlen = 0; @@ -334,12 +334,12 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer, *pktlen = 0; return PACKET_READ_DELIM; } else if (len < 4) { - die("protocol error: bad line length %d", len); + die(_("protocol error: bad line length %d"), len); } len -= 4; if ((unsigned)len >= size) - die("protocol error: bad line length %d", len); + die(_("protocol error: bad line length %d"), len); if (get_packet_data(fd, src_buffer, src_len, buffer, len, options) < 0) { *pktlen = -1; -- cgit v1.2.3