Skip to content

Commit 2dc40bf

Browse files
committed
タグフィールド名に使えない文字「~」を改行エスケープへ回す
改行エスケープをタブ文字でしていたところを「~」でもできるようにさせた。 それに伴いオプション新設。出力で改行エスケープを選択できるように。 それにしてもC@l33tの翻訳がだるいな
1 parent 8d08647 commit 2dc40bf

File tree

11 files changed

+24
-12
lines changed

11 files changed

+24
-12
lines changed

Diff for: nls/C/6.usage

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ %1$s = program name retrieved from argv[0]
1313
$ %2$s = codec name, e.g. Opus, Theora, ...
1414
4 `\
1515
Synopsys:\n\
16-
%1$s [-l] [-C codec] [-i idx] [-DepQRUv] srcfile\n\
16+
%1$s [-l] [-C codec] [-i idx] [-0DepQRUv~] srcfile\n\
1717
%1$s {-a|-w} [-C codec] [-i idx] [-g gain|-s scale] [-0e] [-c tagfile] [-t NAME=VALUE ...] [-d NAME[=VALUE] ...] [-1DQprRUv] srcfile [output]\n\
1818
%1$s [-h]\n\
1919
\n\
@@ -28,6 +28,7 @@ Options:\n\
2828
Specify %2$s index for editing in multiplexed Ogg stream\n\
2929
(1-origin, without non-%2$s stream)\n\
3030
-R Assume tag IO to be encoded in UTF-8\n\
31+
-~ Use '~', not <tab> for escaping line feed\n\
3132
-e Use escape sequence; \\\\, \\n, \\r and \\0\n\
3233
-0 Use '\\0' separation for tag IO\n\
3334
-t NAME=VALUE\n\

Diff for: nls/C@l33t/6.usage

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ %1$s = program name retrieved from argv[0]
1313
$ %2$s = codec name, e.g. Opus, Theora, ...
1414
4 `\
1515
5yn0p5y5:\n\
16-
%1$s [-l] [-C codec] [-i idx] [-DepQRUv] srcfile\n\
16+
%1$s [-l] [-C codec] [-i idx] [-0DepQRUv~] srcfile\n\
1717
%1$s {-a|-w} [-C codec] [-i idx] [-g gain|-s scale] [-0e] [-c tagfile] [-t NAME=VALUE ...] [-d NAME[=VALUE] ...] [-1DQprRUv] srcfile [output]\n\
1818
%1$s [-h]\n\
1919
\n\
@@ -28,6 +28,7 @@ $ %2$s = codec name, e.g. Opus, Theora, ...
2828
5p3c1fy %2$s 1nd3x f0r 3d171n6 1n mul71pl3x3d 066 57r34m\n\
2929
(1-0r161n, w17h0u7 n0n-%2$s 57r34m)\n\
3030
-R 455um3 746 10 70 b3 3nc0d3d 1n u7f-8\n\
31+
-~ u53 '~', n07 <74b> f0r 35c4p1n6 l1n3 f33d\n\
3132
-e u53 35c4p3 53qu3nc3; \\\\, \\n, \\r 4nd \\0\n\
3233
-0 u53 '\\0' 53p4r4710n f0r 746 10\n\
3334
-t NAME=VALUE\n\

Diff for: nls/en_US.ISO8859-1/6.usage

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ %1$s = program name retrieved from argv[0]
1313
$ %2$s = codec name, e.g. Opus, Theora, ...
1414
4 `\
1515
Synopsys:\n\
16-
%1$s [-l] [-C codec] [-i idx] [-DepQRUv] srcfile\n\
16+
%1$s [-l] [-C codec] [-i idx] [-0DepQRUv~] srcfile\n\
1717
%1$s {-a|-w} [-C codec] [-i idx] [-g gain|-s scale] [-0e] [-c tagfile] [-t NAME=VALUE ...] [-d NAME[=VALUE] ...] [-1DQprRUv] srcfile [output]\n\
1818
%1$s [-h]\n\
1919
\n\
@@ -28,6 +28,7 @@ Options:\n\
2828
Specify %2$s index for editing in multiplexed Ogg stream\n\
2929
(1-origin, without non-%2$s stream)\n\
3030
-R Assume tag IO to be encoded in UTF-8\n\
31+
-~ Use '~', not <tab> for escaping line feed\n\
3132
-e Use escape sequence; \\\\, \\n, \\r and \\0\n\
3233
-0 Use '\\0' separation for tag IO\n\
3334
-t NAME=VALUE\n\

Diff for: nls/en_US.UTF-8/6.usage

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ %1$s = program name retrieved from argv[0]
1313
$ %2$s = codec name, e.g. Opus, Theora, ...
1414
4 `\
1515
Synopsys:\n\
16-
%1$s [-l] [-C codec] [-i idx] [-DepQRUv] srcfile\n\
16+
%1$s [-l] [-C codec] [-i idx] [-0DepQRUv~] srcfile\n\
1717
%1$s {-a|-w} [-C codec] [-i idx] [-g gain|-s scale] [-0e] [-c tagfile] [-t NAME=VALUE ...] [-d NAME[=VALUE] ...] [-1DQprRUv] srcfile [output]\n\
1818
%1$s [-h]\n\
1919
\n\
@@ -28,6 +28,7 @@ Options:\n\
2828
Specify %2$s index for editing in multiplexed Ogg stream\n\
2929
(1-origin, without non-%2$s stream)\n\
3030
-R Assume tag IO to be encoded in UTF-8\n\
31+
-~ Use '~', not <tab> for escaping line feed\n\
3132
-e Use escape sequence; \\\\, \\n, \\r and \\0\n\
3233
-0 Use '\\0' separation for tag IO\n\
3334
-t NAME=VALUE\n\

Diff for: nls/ja_JP.UTF-8/6.usage

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ %1$s = argv[0]から取得したプログラム名
1313
$ %2$s = コーデック名。Opus、Theora等
1414
4 `\
1515
使い方:\n\
16-
%1$s [-l] [-C codec] [-i idx] [-DepQRUv] srcfile\n\
16+
%1$s [-l] [-C codec] [-i idx] [-0DepQRUv~] srcfile\n\
1717
%1$s {-a|-w} [-C codec] [-i idx] [-g gain|-s scale] [-0e] [-c tagfile] [-t NAME=VALUE ...] [-d NAME[=VALUE] ...] [-1DQprRUv] srcfile [output]\n\
1818
%1$s [-h]\n\
1919
\n\
@@ -28,6 +28,7 @@ $ %2$s = コーデック名。Opus、Theora等
2828
多重化されたOggストリーム中の編集対象の%2$sストリームを、\n\
2929
%2$s以外のものを除いた1起点の順番で指定する。\n\
3030
-R タグ入出力の文字符号化方式をUTF-8として扱う\n\
31+
-~ 改行のエスケープにタブではなく「~」を使う\n\
3132
-e バックスラッシュ、改行、復帰、ヌルにそれぞれ\n\
3233
\\\\, \\n, \\r, \\0のエスケープを使用する\n\
3334
-0 タグ入出力に'\\0'区切りを使う\n\

Diff for: nls/ja_JP.eucJP/6.usage

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ %1$s = argv[0]
1313
$ %2$s = �����ǥå�̾��Opus��Theora��
1414
4 `\
1515
�Ȥ���:\n\
16-
%1$s [-l] [-C codec] [-i idx] [-DepQRUv] srcfile\n\
16+
%1$s [-l] [-C codec] [-i idx] [-0DepQRUv~] srcfile\n\
1717
%1$s {-a|-w} [-C codec] [-i idx] [-g gain|-s scale] [-0e] [-c tagfile] [-t NAME=VALUE ...] [-d NAME[=VALUE] ...] [-1DQprRUv] srcfile [output]\n\
1818
%1$s [-h]\n\
1919
\n\
@@ -28,6 +28,7 @@ $ %2$s =
2828
¿�Ų����줿Ogg���ȥ꡼������Խ��оݤ�%2$s���ȥ꡼���\n\
2929
%2$s�ʳ��Τ�Τ������1�����ν��֤ǻ��ꤹ�롣\n\
3030
-R ���������Ϥ�ʸ����沽������UTF-8�Ȥ��ư���\n\
31+
-~ ���ԤΥ��������פ˥��֤ǤϤʤ���~�פ�Ȥ�\n\
3132
-e �Хå�����å��塢���ԡ��������̥�ˤ��줾��\n\
3233
\\\\, \\n, \\r, \\0�Υ��������פ���Ѥ���\n\
3334
-0 ���������Ϥ�'\\0'���ڤ��Ȥ�\n\

Diff for: src/global.h

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ GLOBAL struct {
3333
TAG_ESCAPE_BACKSLASH,
3434
TAG_ESCAPE_NUL,
3535
} tag_escape;
36+
bool tag_escape_tilde;
3637
bool tag_raw;
3738
bool tag_toupper;
3839
char *tag_filename;

Diff for: src/main.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static void usage(void) {
3232

3333
fprintf(stderr, catgets(catd, 6, 4,
3434
"Synopsys:\n"
35-
" %1$s [-l] [-C codec] [-i idx] [-DepQRUv] srcfile\n"
35+
" %1$s [-l] [-C codec] [-i idx] [-0DepQRUv~] srcfile\n"
3636
" %1$s {-a|-w} [-C codec] [-i idx] [-g gain|-s scale] [-0e] [-c tagfile] [-t NAME=VALUE ...] [-d NAME[=VALUE] ...] [-1DQprRUv] srcfile [output]\n"
3737
" %1$s [-h]\n"
3838
"\n"
@@ -47,6 +47,7 @@ static void usage(void) {
4747
" Specify %2$s index for editing in multiplexed Ogg stream\n"
4848
" (1-origin, without non-%2$s stream)\n"
4949
" -R Assume tag IO to be encoded in UTF-8\n"
50+
" -~ Use '~', not <tab> for escaping line feed"
5051
" -e Use escape sequence; \\\\, \\n, \\r and \\0\n"
5152
" -0 Use '\\0' separation for tag IO\n"
5253
" -t NAME=VALUE\n"
@@ -101,7 +102,7 @@ static void parse_args(int argc, char **argv) {
101102
int gainfmt;
102103
double gv;
103104

104-
while ((c = getopt(argc, argv, "01ac:C:d:Deg:hi:lpqQrRs:t:TUvVw")) != -1) {
105+
while ((c = getopt(argc, argv, "01ac:C:d:Deg:hi:lpqQrRs:t:TUvVw~")) != -1) {
105106
switch (c) {
106107
case 'l':
107108
O.edit = EDIT_LIST;
@@ -158,6 +159,10 @@ static void parse_args(int argc, char **argv) {
158159
O.tag_raw = true;
159160
break;
160161

162+
case '~':
163+
O.tag_escape_tilde = true;
164+
break;
165+
161166
case 'e':
162167
O.tag_escape = TAG_ESCAPE_BACKSLASH;
163168
break;

Diff for: src/parse-tags.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void line_oc(uint8_t *line, size_t n, bool lf) {
347347
}
348348

349349
if (afterlf) {
350-
if (*line == 0x9) {
350+
if (*line == 0x9 || *line == 0x7e) {
351351
*line = 0x0a;
352352
if (lf) n--;
353353
append_buffer(line, n);

Diff for: src/put-tags.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static uint8_t *esc_oc(uint8_t *src, uint8_t *dest, size_t len) {
3838
uint8_t *end = src + len;
3939
while(src < end) {
4040
*dest++ = *src++;
41-
if (src[-1] == 0xa) *dest++ = 0x9;
41+
if (src[-1] == 0xa) *dest++ = O.tag_escape_tilde ? 0x7e : 0x9;
4242
}
4343
return dest;
4444
}

Diff for: src/version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#define OPUSCOMMENT_VERSION "1.5.7"
1+
#define OPUSCOMMENT_VERSION "1.5.8"
22

33
#define OPUSCOMMENT_REVISION_YEAR (2019 - 1900)
44
#define OPUSCOMMENT_REVISION_MONTH (6 - 1)
5-
#define OPUSCOMMENT_REVISION_DAY 1
5+
#define OPUSCOMMENT_REVISION_DAY 2

0 commit comments

Comments
 (0)