Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
pkt-line.c: mark more strings for translation
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sat, 21 Jul 2018 07:49:34 +0000
(09:49 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 23 Jul 2018 18:19:10 +0000
(11:19 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pkt-line.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
4224658
)
diff --git
a/pkt-line.c
b/pkt-line.c
index 941e41dfc13493da770d8b55bd9de33d375b555e..04d10bbd037b393574f8453cbd00f94e0b2e7e99 100644
(file)
--- 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)
{
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;
}
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)
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);
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);
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;
}
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)
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)
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))
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, ...)
}
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)
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);
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)
} 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. */
}
/* 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;
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;
}
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) {
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;
} 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) {
*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)
}
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;
if (get_packet_data(fd, src_buffer, src_len, buffer, len, options) < 0) {
*pktlen = -1;